现在的位置: 首页 > 综合 > 正文

表格 隔行颜色不同 Css

2013年03月24日 ⁄ 综合 ⁄ 共 828字 ⁄ 字号 评论关闭

<style>
.mytb {
 width:300px;
 height:20px;
 border-bottom: 1px #f00 solid;
}
.mytb th {
 background-color: #ff9d7f;
 border: 1px #ff9d7f solid;
 border-bottom: 1px #f00 solid;
}
.mytb td {
 text-align: center;
   background-color:expression((this.parentElement.sectionRowIndex%2==0)?'#efffa7':'#fff');
 border-top:expression((this.parentElement.sectionRowIndex%2==0)?'1px #00f solid':'0px');
 border-bottom:expression((this.parentElement.sectionRowIndex%2==0)?'1px #00f solid':'0px');

 border-left:expression((this.cellIndex==0)?'1px #f00 solid':'0px');
 border-right:expression((this.cellIndex==2)?'1px #f00 solid':'0px');
}
</style>
<table class="mytb" cellspacing="0" cellpadding="0">
<tr><th>000</th><th>000</th><th>000</th></tr>
<tr><td>000</td><td>000</td><td>000</td></tr>
<tr><td>000</td><td>000</td><td>000</td></tr>
<tr><td>000</td><td>000</td><td>000</td></tr>
</table>

抱歉!评论已关闭.