页面中如果有多个表格时,使每个表都从第一行计数
jqery代码:
$('tr:nth-child(odd)').addClass('alt');
css代码:
.alt {
background-color: #ccc;
}
PS:另一行为背景色为默认颜色。
转载于:https://blog.51cto.com/chcchb/1372542
页面中如果有多个表格时,使每个表都从第一行计数
jqery代码:
$('tr:nth-child(odd)').addClass('alt');
css代码:
.alt {
background-color: #ccc;
}
PS:另一行为背景色为默认颜色。
转载于:https://blog.51cto.com/chcchb/1372542