【问题标题】:Sort a table with multiple <tbody> in jquery table sorter 2.0在jquery table sorter 2.0中对具有多个<tbody>的表进行排序
【发布时间】:2013-07-15 23:17:11
【问题描述】:

我有一张桌子可以说

<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 对其进行排序 它只对单个 tbody 进行排序。

【问题讨论】:

标签: jquery sorting tablesorter


【解决方案1】:

我有一个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>

【讨论】:

  • 我想对每个 tbody 内的 tbodies 进行排序,而不是 tr。我想在每个 tbody 内使用 td 对 tbodies 进行排序。就像上面的例子一样,我想使用名称。对身体进行排序。
  • 啊,好吧,我有a request for this ability,但由于时间限制,我从来没有开始实施它;对不起。我链接的拉取请求没有按预期工作。
猜你喜欢
  • 2017-06-19
  • 1970-01-01
  • 2015-09-03
  • 1970-01-01
  • 2013-04-15
  • 1970-01-01
  • 2012-07-22
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多