表格一行一行如何间隔显示颜色

来源:百度知道 编辑:UC知道 时间:2024/05/28 18:43:44
比如单数行是蓝色,双数行是绿色那样的效果·很普遍。。还有如果不用表格展示数据,该如何设置CSS呢??

楼上,两个都在乱回答!

最简单的办法,重复的背景图,一行蓝一行绿,加在表格、div、li上面都可以

选定整个工作表,让默认光标停在A1:
格式——条件格式——公式:
=mod(row(a1),2)=1
设置颜色为灰色或者你想要的颜色,确定!

<style type="text/css">
.single
{
background-color:blue;
}
.double
{
background-color:green;
}
</style>

<div class='single' style='width:100px;height:10px'></div>
<div class='double' style='width:100px;height:10px'></div>
<div class='single' style='width:100px;height:10px'></div>
<div class='double' style='width:100px;height:10px'></div>

如果还有问题,可以直接M我.我在线的