-3

我已经动态创建了一个表。该表加载数据表单数据库。这是以下代码。

$('#artistinfo').empty();
$('#artistinfo').append('<table  id="transactions" class="partner" width="100%" cellpadding="0" cellspacing="0" style="font-size:90%;" />');
$('#artistinfo table').append(
' <tr class="thead"><th valign="top">Artist</th><th valign="top">Release</th> <th valign="top">Score</th>  </tr>');
$('#artistinfo table').append('<tr>' +
'<td>' + artistname + '</td>' +
'<td>' + releasename + '</td>' +
'<td>' + score+ '</td>' +
'</tr>'
);

我想按每个颜色对表格进行排序。jquery可以吗?

例如,分数是一个数字类型。我想按升序或降序排序

4

1 回答 1

0

仅使用 jQuery 做您想做的事情会非常昂贵,因为默认情况下不会提供此功能。我不会重新发明轮子,而是通过这些插件:DataTablesjqGrid。这两个提供了相当不错的 API 和广泛的功能,而且似乎它们也旨在提供良好的性能。

当然,显示网格的插件要多得多,你可以试试谷歌。

于 2013-02-25T14:20:25.803 回答