jQuery 表格排序插件 Tablesorter 使用
jQuery 表格排序插件 Tablesorter 使用方式如下:
1.引入头文件(注意一定要把jQuery放在前面):
<script src="lib/jquery-1.8.3.min.js"></script> <!--tablesorter--> <link href="css/css_tablesorter_green/style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="lib/jquery.tablesorter.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#alltable").tablesorter(); }); </script>
2.在需要使用排序的<Table>上无需做任何设定,很方便:
<table id="alltable" class="tablesorter" width="584"> <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>[email protected]</td> <td>$50.00</td> <td>http://www.jsmith.com</td> </tr> <tr> <td>Bach</td> <td>Frank</td> <td>[email protected]</td> <td>$50.00</td> <td>http://www.frank.com</td> </tr> <tr> <td>Doe</td> <td>Jason</td> <td>[email protected]</td> <td>$100.00</td> <td>http://www.jdoe.com</td> </tr> <tr> <td>Conway</td> <td>Tim</td> <td>[email protected]</td> <td>$50.00</td> <td>http://www.timconway.com</td> </tr> </tbody> </table>
在<thead>上就会有两个小三角符号,点击可以用于排序。
Tablesorter下载地址:http://download.csdn.net/detail/leixiaohua1020/6377187
相关推荐
EdwardSiCong 2020-11-23
85477104 2020-11-17
hhanbj 2020-11-17
81427005 2020-11-11
seoppt 2020-09-13
honeyth 2020-09-13
WRITEFORSHARE 2020-09-13
84483065 2020-09-11
momode 2020-09-11
85477104 2020-08-15
83510998 2020-08-08
82550495 2020-08-03
tthappyer 2020-08-03
84901334 2020-07-28
tthappyer 2020-07-25
TONIYH 2020-07-22
tztzyzyz 2020-07-20
83510998 2020-07-18
81463166 2020-07-17