【发布时间】:2014-02-15 09:03:18
【问题描述】:
我正在使用这个 css 代码:
.even{
background: #E4ECF6;
}
.odd{
background: #F3F7FB;
}
.firstrow{
background-color: #599ECF;
}
我正在使用这个 css jquery 代码:
$(document).ready(function(){
$('table tr:even').addClass('even');
$('table tr:odd').addClass('odd');
$('table tr:first').addClass('firstrow');
});
此代码在第一个表中正确运行。但是当我有两个或更多表时,此代码可以为第一个表的第一行着色。为所有表中的所有第一行着色更好的代码?
【问题讨论】:
-
this question 单独询问多表的第一行,但我想要所有表的第一行。
标签: jquery row html-table