JQuery 表排序器 : How to show the arrows on one column only

标签 jquery sorting html-table tablesorter

我正在实现jquery的tablesorter。 但我似乎找不到一种方法来执行以下操作:

  1. 仅在一列上显示排序箭头
  2. 仅允许通过单击该列对表格进行排序,并且当 单击其他列不会执行任何操作。

我用谷歌搜索了很多,但没有结果。

这是我的 table :

<table id="myTable" class="tablesorter"> 
<thead> 
<tr> 
    <th>Last Name</th> 
    <th>First Name</th> 
    <th>Email</th> 
    <th>Due</th> 
    <th>Web Site</th> 
</tr> 
</thead> 
<tbody> 
<tr> 
    <td>Smith</td> 
    <td>John</td> 
    <td><a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="18726b75716c70587f75797174367b7775" rel="noreferrer noopener nofollow">[email protected]</a></td> 
    <td>$50.00</td> 
    <td>http://www.jsmith.com</td> 
</tr> 
<tr> 
    <td>Bach</td> 
    <td>Frank</td> 
    <td><a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1f797d7e7c775f667e777070317c7072" rel="noreferrer noopener nofollow">[email protected]</a></td> 
    <td>$50.00</td> 
    <td>http://www.frank.com</td> 
</tr> 
<tr> 
    <td>Doe</td> 
    <td>Jason</td> 
    <td><a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7d171912183d151209101c1411531e1210" rel="noreferrer noopener nofollow">[email protected]</a></td> 
    <td>$100.00</td> 
    <td>http://www.jdoe.com</td> 
</tr> 
<tr> 
    <td>Conway</td> 
    <td>Tim</td> 
    <td><a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fd899e92938a9c84bd989c8f899591949396d3939889" rel="noreferrer noopener nofollow">[email protected]</a></td> 
    <td>$50.00</td> 
    <td>http://www.timconway.com</td> 
</tr> 
</tbody> 
</table> 

最佳答案

看看这里 http://tablesorter.com/docs/#Configuration

在标题属性

关于JQuery 表排序器 : How to show the arrows on one column only,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11762141/

相关文章:

java - 比较对象数组中的字母数字字符串

javascript - 使用 div 标签和 Bootstrap 类更新 DOM

swift - 如何在 Swift 中按属性对结构进行排序

javascript - 如何通过javascript将值传递到输入字段

java - 快速排序算法在最坏的情况下无法完成

jQuery .after() 方法插入一行并将其自身填充到一个单元格中。为什么?

javascript - 单击链接时显示一些文本

javascript - 如何从选定的表格行中获取最小和最大数量?

php - jquery masonry 图像重叠,直到完成页面大小调整

javascript - KendoEditor 将焦点设置在文本末尾