私はそのようなhtmlテーブル構造を持っています:
<table cellpadding="0" cellspasing="0" class="tablesorter zebra" id="articles-table">
<tbody>...etc standart stuff...
<tr>
<td>
</td>
</tr>
then i have
<tr id="123123">
<td colspan="7">
Analogs
</td>
</tr>
<tr id="prcol">
<td>
<td>
</td>
</td>
<tr>
...
</table>
私はそのようなスクリプトを試しました:
jQuery(function($) {
var table = $('table');
$(document).ready(function () {
$('#prcol')
.each(function(){
var th = $(this),
thIndex = th.index(),
inverse = false;
th.click(function(){
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(){
return this.parentNode;
});
inverse = !inverse;
});
});
});
});
しかし、主な問題は、すべてを並べ替えていることですid 123123
...
2番目のdivのみにあるフロート番号でソートする必要があります! ID = 123のtrでは、これは重要です...また、Webで見られるすべてのソリューションは巨大です...特定のIDを持ついくつかのtrで単純なソート2番目のtdが必要です...どうすれば解決できますか?
tablesorter.com を試してみました。しかし、それは私のものではありません...一部のTRだけにカスタマイズすることはできません...また、ドキュメントがロードされた場合はソーターにする必要があります。
ここでも#2を試してください: リンク
1列目はまだ悩み中…