Created
June 4, 2012 20:34
-
-
Save joequery/2870704 to your computer and use it in GitHub Desktop.
Stupidtable example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>Stupid jQuery table sort</title> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
| <script type="text/javascript" src="stupidtable.js?dev"></script> | |
| <script type="text/javascript"> | |
| $(function(){ | |
| $("table").stupidtable(); | |
| console.log($("table tbody tr td").eq(0)) | |
| $("table th").bind("click", function(){ | |
| console.log($("table tbody tr td").eq(0)) | |
| }); | |
| }); | |
| </script> | |
| <style type="text/css"> | |
| tr.awesome{ | |
| color: red; | |
| } | |
| th[class|="type"]{ | |
| cursor:pointer; | |
| } | |
| </style> | |
| </style> | |
| </head> | |
| <body> | |
| <h1>Stupid jQuery table sort!</h1> | |
| <table border="1"> | |
| <thead> | |
| <tr> | |
| <th class="type-int awesome">int</th> | |
| <th class="type-float">float</th> | |
| <th class="type-string">string</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| <tr> | |
| <td>15</td> | |
| <td>-.18</td> | |
| <td>banana</td> | |
| </tr> | |
| <tr class="awesome"> | |
| <td>95</td> | |
| <td>36</td> | |
| <td>coke</td> | |
| </tr> | |
| <tr> | |
| <td>2</td> | |
| <td>-152.5</td> | |
| <td>apple</td> | |
| </tr> | |
| <tr> | |
| <td>-53</td> | |
| <td>88.5</td> | |
| <td>zebra</td> | |
| </tr> | |
| <tr> | |
| <td>195</td> | |
| <td>-858</td> | |
| <td>orange</td> | |
| </tr> | |
| </tbody> | |
| </table> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment