您的位置:首页 > 其它

表格的隔行变色,实现方法

2014-11-10 14:42 441 查看
表格中的隔行变色,很常见

1.css3实现:pc端现在支持的不多

table li:nth-of-type(odd){background:#FAFAFA;}/*奇数行*/
table li:nth-of-type(even){background:#FAFAFA;}/*偶数行*/


2.jquery 实现 :兼容大部分的浏览器

$("tr:odd").css("background-color","#FAFAFA");
$("tr:even").css("background-color","#FAFAFA");
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: