我有很多表在我的网站上使用tablesorter,我正在寻找一种方法来排序“sorter:'digit'具有特定类名的列:”class =“note”。Tablesorter和自动分拣机数字?
我知道的一个头要做到这一点:
$(".tablesorter").tablesorter({
headers: {
0: { sorter: 'digit' } // column number, type
} });
但有一个通用的方法来做到这一点是这样的HTML:
<th class="{sorter: 'digit'}">Note</th>
或与类名<th class="note">Note</th>
在这样的JavaScript的某处
$(".tablesorter .note").tablesorter() ...
?
因为我的专栏“注意”有时是第三列,有时第五等
我问这个,因为没有指定的“数字”命令,的tablesorter不知道如何分类编号...这里是un jsfiddle来展示我的意思:http://jsfiddle.net/2cmuy39L/
谢谢。
您是否阅读过http://tablesorter.com/docs/#Demo? – bodi0 2014-10-08 13:50:43