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

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

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 ;
}
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 ;
}
Code Source : http://www.flaspx.com/weblog/index.php
?????????????????????? http://www.blueidea.com/tech/web/2006/3799.asp