我在其中一本jQuery书籍中看到,您可以突出显示正在排序的列。突出显示一列
$('th.sortable').click(function() {
var $th = $(this);
var column = $th.index();
var $table = $th.closest('table');
var rows = $table.find('tr:not(:has(th))').get();
问:如何将'hightlight'类添加到单击的列中的每个单元格?
请注意,_index_是基于零的,而_nth-child_是基于1的。 – 2010-10-19 20:28:19
你说得对,我已经更新了。 – Harmen 2010-10-19 20:28:48