在jquery表分类器2.0中对多个表进行排序

时间:2013-07-17 11:56:47

标签: jquery sorting tablesorter

我有一张桌子可以说

<table id="myTable">
  <thead>
    <th>id</th>
    <th>name</th>
  </thead>
  <tbody>
    <tr>
      <td>1</td>
      <td>Sam</td>
    </tr>
  </tbody>
  <tbody>
    <tr>
      <td>2</td>
      <td>Alex</td>
    </tr>
  </tbody>
</table>

如果使用$("#myTbale").tablesorter();,如何使用tablesorter 2.0对此进行排序 它只排序一个。

1 个答案:

答案 0 :(得分:0)

我有一个fork of tablesorter,它会分别对每个tbody进行排序。如果你有一个你不想排序的tbody,那么添加cssInfoBlock option中包含的类名 - 默认为tablesorter-infoOnly

<tbody class="tablesorter-infoOnly">
  <tr>
    <th>The contents of this tbody</th>
  </tr>
  <tr>
    <td>will not be sorted</td>
  </tr>
</tbody>
相关问题