如何使用表排序脚本对span列标题进行排序

时间:2012-08-14 11:18:01

标签: jquery datatables tablesorter

我正在尝试对html表进行排序,如下所示

enter image description here

我喜欢在点击表格标题时排序(人物,用户#,唯一标识,全名,反编号,标记,进出)。

如何使用表格排序单击User#以及UniqueID列进行排序?

1 个答案:

答案 0 :(得分:0)

嗯,它仍然不完美,但我在github上有一个tablesorter的分叉,它能够对点击列下面的列进行排序...尝试“全名”标题单元格来查看我的意思。我需要修改它在“Product”和“In”列中更新css的方式。

无论如何,here is a demo使用上图中的信息。它使用的是未记录的cssChildRow选项 - 请参阅original demo here。第二个演示的代码被添加到tablesorter 2.0.5中。 here is the same demo使用原始的tablesorter ...您可以看到点击“全名”列只会对“ID#”列进行排序