码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-04-18 15:17:47      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:

表格中的隔行变色,很常见

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");

 

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

标签:

原文地址:http://www.cnblogs.com/duhuo/p/5404346.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!