Jquery 使用tablesorter根据另一列的值对一列进行排序?
我有一张看起来有点像这样的桌子:Jquery 使用tablesorter根据另一列的值对一列进行排序?,jquery,tablesorter,Jquery,Tablesorter,我有一张看起来有点像这样的桌子: ID Paragraph Title 1 §1-1 This is the first 2 §2-1 This is the second ... 12 §10-1 This is the twelfth “ID”列是隐藏的,其他两列是可见的。我已经设法让JQuery Tablesorter对段落和标题列进行排序,但是我希望在对段落列进行排序时使用ID值。这仅仅是因
ID Paragraph Title
1 §1-1 This is the first
2 §2-1 This is the second
...
12 §10-1 This is the twelfth
“ID”列是隐藏的,其他两列是可见的。我已经设法让JQuery Tablesorter对段落和标题列进行排序,但是我希望在对段落列进行排序时使用ID值。这仅仅是因为在使用段落列时排序不正确,这一点很容易看出
在对段落列进行排序时,是否可以让tablesorter使用ID列/值?我认为最简单的解决方案是在段落列中添加一个隐藏的跨距,ID在里面,后面加一个空格,将其与文本分开(
#
)()
1.
案文第1段
加上JQuery元数据插件和表头上的一点魔力,这一切都起到了作用。神奇之处在于:
<tr>
<td>1</td>
<td><span class="hidden">1 </span>Paragraph of text</td>
</tr>