私はこの投稿( jQueryテーブルソート)からリードを取りました-私がやっていることをやろうとしています...
コードはここにあります。 http://jsfiddle.net/daqGC/
それは機能していません...どんな考えでも
ここにjsコードがあります。HTML は jsFiddle にあります。
var user_table = $( '#users' );
$('#company_header, #user_header, #email_header, #type_header')
.wrapInner('<span title="sort this column"/>')
.each(function(){
var th = $(this),
thIndex = th.index(),
inverse = false;
th.click(function(){
user_table.find('td').filter(function(){
return $(this).index() === thIndex;
}).sortElements(function(a, b){
return $.text([a]) > $.text([b]) ?
inverse ? -1 : 1
: inverse ? 1 : -1;
}, function(){
// parentNode is the element we want to move
return this.parentNode;
});
inverse = !inverse;
});
});
どうも