每行select第一个TD w / jQuery
如何为表中每一行的每个第一个单元格分配样式?
$("#myTable tr td:first").addClass("black");  使用:first-child伪类而不是:first 。 
 $("#myTable tr td:first-child").addClass("black"); 
 第:first伪类实际上是select列表中返回的第一个元素。 例如, $('div span:first')只会返回发生第一个div的第一个跨度。 
 第:first-child伪类select特定父代下的第一个元素,但返回与第一个孩子相同的元素。 例如, $('table tr td:first-child')返回每一行的第一个单元格。 
 当你使用时:first ,它只返回碰巧被选中的第一行的第一个单元格。 
有关更多信息,请参阅jQuery文档:
 你是非常接近,我认为你需要的是:first-child而不是:first ,所以这样的事情: 
 $("#myTable tr td:first-child").addClass("black"); 
 $("#myTable tr").find("td:first").addClass("black"); 
喜欢这个:
 $("#myTable tr").each(function(){ $(this).find('td:eq(0)').addClass("black"); }); 
尝试:
 $("#myTable td:first-child").addClass("black");