禁用对具有多个tbody的表的某个tbody应用表分类器

时间:2012-10-26 19:35:50

标签: jquery tablesorter

我在同一张桌子里有两个不同的人。我只想在第一个tbody上使用表格分类器。有没有办法跳过使用tablesorter单独的第二个t ???

<table>
<tbody id="1"></tbody>  /* Apply table sorter for this tbody */
<tbody id="2"></tbody>  /* Don't Apply table sorter for this tbody*/
</table>

2 个答案:

答案 0 :(得分:0)

我猜你正在使用支持fork of tablesortersorting multiple tbodies。原始插件只对第一个tbody进行排序。

如果您希望tablesorter忽略任何tbody,只需将类名tablesorter-infoOnly添加到tbody即可。此类名由cssInfoBlock option设置。

请注意,除非表格包含thead,否则tablesorter将无法使用您在上面共享的HTML。

答案 1 :(得分:0)

将第二个tbody作为另一个表,并使用CSS使它们看起来像一个表。

<table>/* Apply table sorter for this table */
<tbody id="1"></tbody>  
</table>

<table>/* Don't Apply table sorter for this table*/
<tbody id="2"></tbody>  
</table>
相关问题