joequery
6/4/2012 - 8:34 PM

Stupidtable example

Stupidtable example

<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>