close
一個Javascript 的類庫,用於table內容排序。使用很方便,不用每次都去調用數據庫了。
特別適合多表查詢的排序。加上<tbody>的style.display 切換,也可以實現分頁。

點擊下載效果演示...

用法:

1.添加JS

程序代碼 程序代碼
<SCRIPT src="sorttable.js" type="text/javascript"></SCRIPT>


2.添加TABLE,注意的是:一定要有ID,class為"sortable"

程序代碼 程序代碼
<table class="sortable" id="mytable">


OK!可以了,簡單的吧
如果覺得太單調,自己加點CSS吧,官方給出了改HEAD的CSS

程序代碼 程序代碼
/* Sortable tables */
table.sortable a.sortheader {
    background-color:#eee;
    color:#666666;
    font-weight: bold;
    text-decoration: none;
    display: block;
}
table.sortable span.sortarrow {
    color:black;
    text-decoration: none;
}


官方網站 | JS文件下載
arrow
arrow
    全站熱搜

    kevin0523 發表在 痞客邦 留言(0) 人氣()