// nth-child(even)
$("table tr:nth-child(even)").css("background","red")

// :even
$('table tr:even').css('background-color','red');

本文详细介绍了使用CSS选择器选择表格中偶数行的方法,包括使用nth-child(even)和:even伪类。通过实践示例,帮助开发者轻松实现样式调整。
// nth-child(even)
$("table tr:nth-child(even)").css("background","red")

// :even
$('table tr:even').css('background-color','red');

1147

被折叠的 条评论
为什么被折叠?