Jquery 将类添加到td,但每行的第一列和第二列除外

Jquery 将类添加到td,但每行的第一列和第二列除外,jquery,Jquery,除了每行的第一列和第二列之外,我必须向td添加类 使用。这将选择大于列索引的td $(".csstablelisttd").live('mousedown', function (e) { var rowIndex = $(this).closest("tr").index(); var colIndex = $(e.target).closest('td').index(); $('#contentPlaceHolderMain_tableAppointme

除了每行的第一列和第二列之外,我必须向td添加类

使用。这将选择大于列索引的td

$(".csstablelisttd").live('mousedown', function (e)
{    
    var rowIndex = $(this).closest("tr").index();
    var colIndex = $(e.target).closest('td').index();  
    $('#contentPlaceHolderMain_tableAppointment tr').eq(rowIndex).find('td').eq(colIndex).addClass('csstdhighlight');
});
将其写为-

$('table tr').find('td:gt(1)').css('color','red');​

这会将类添加到每行中除前两行之外的所有TDs中

$('tr').find('td:gt(1)').addClass('csstdhighlight');

这样做

我在列索引和行索引中添加类,并通过类似于
td:first child
td:nth child(2)
@lax:
gt
将从第三个
td
中选择,除了第一个和第二个see in fiddle之外,我没有只看到类,没有比索引1大的时间间隔。:)嗨,迪帕克,我能问你一个问题吗?我必须得到开始时间和结束时间…开始时间可以得到哪个单元格拖动开始和结束时间可以得到哪个单元格拖动结束?
if (colIndex == 0 || colIndex == 1)
return;