最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
jquery.tableSort.js表格排序插件使用方法详解
时间:2017-03-27 编辑:简简单单 来源:一聚教程网
1.一定要引jQuery包,所有jq插件都是基于jQuery包的
2.如果想指定哪一栏不排序这样写$(“#mytable”).tablesorter({headers:{5:{sorter:false}}});第5列的sorter为false就OK了
代码如下 | 复制代码 | ||
#tip { border: solid 1px black; width: 358px; line-height: 21px; height: 21px; padding: 2px 10px; background-color: pink; font-size: 12px; text-align: center; margin: 10px auto 10px; }
.table { width: 380px; margin: 0 auto; border-collapse: collapse; text-align: center; }
.table tr td, .table tr th { background: greenyellow; border: solid 1px red; color: #666; height: 30px; /*line-height: 30px;*/ }
.table tr th { background: #89AFB1; color: red; text-align: center; font-size: 14px; }
.table a, .table a:visited { color: red; text-decoration: none }
.table a:hover, .table a:active { color: blue; text-decoration: none }
$(function() { $('table').tablesort().data('tablesort'); var i = 0; $(".table tr th a").click(function() { if (i % 2 == 0) { $(".sj").text('升序'); i++; } else { $(".sj").text('降序'); i++; } }) })
| |||
1031 | 李渊 | 男 | 654 |
1021 | 张扬 | 男 | 624 |
1011 | 吴敏 | 女 | 632 |
1026 | 李小明 | 男 | 610 |
1016 | 周谨 | 女 | 690 |
1041 | 谢小敏 | 女 | 632 |
1072 | 刘明明 | 男 | 633 |
1063 | 蒋忠公 | 男 | 675 |
-
下一个: Mybatis结果生成键值对的实例代码
相关文章
- HTML简单购物数量小程序代码展示 10-31
- html canvas实现弹幕功能 10-31
- HTML中空格表示的意义 10-31
- html area标签解读 10-31
- html使用表单标签实现注册页面代码展示 10-31
- 使用HTML截图并保存为本地图片的代码展示 10-31