这次使用的是jquery.tablesorter.js来排序
1.
<link href="/Scripts/jqueryplugin/tablesorter/style.css" rel="stylesheet" type="text/css" /> <script src="/Scripts/jqueryplugin/jquery.tablesorter.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { $("#tbMain").tablesorter(); }); </script>
2.要排序的用th标识
<table id="tbMain" class="tablesorter InfoTable"> <thead> <tr> <th> 日期 </th> <th> 住宿人数 </th> <td> 游览人数 </td> </tr> </thead>
3.在itemtemplate中加入各种tr>td 结束了
4.如图