怎么用css实现多行表头白底色但是内容隔行变色的效果
axer 2006-05-15 05:03:46 代码如下,内容实现了隔行变色,但是表头我不想要变色,仍然要保持白底,怎么弄啊?谢谢大家。
<style type="text/css">
<!--
table{border:1px solid #000;border-width:1px 0 0 1px;margin:2px 0 2px 0;text-align:center;border-collapse:collapse;font-family:"arial"; font-size: 12px; font-style: normal; line-height: 17px;}
td{border:1px solid #000;border-width:0 1px 1px 0;margin:2px 0 2px 0;text-align:left;}
tr{background-color:expression("#FFFFFF,#C0C0C0".split(",")[rowIndex%2])}
r1{background-color :white;}
-->
</style>
<table width="720" align="center" id="table1">
<tr style="BACKGROUND-COLOR: #ffffff">
<td >
<strong>item</strong></td>
<td colSpan="4" rowSpan="2" style="font-family: Arial; font-size: 12px; line-height: 15px">
<strong>Boundary dimensions (mm) </strong></td>
<td colSpan="2" style="font-family: Arial; font-size: 12px; line-height: 15px">
<strong>Basic load ratings </strong></td>
<td colSpan="2" style="font-family: Arial; font-size: 12px; line-height: 15px">
<strong>Limiting speeds </strong></td>
<td>
<strong>Mass </strong></td>
</tr>
<tr>
<td class="r1">
<strong>No. </strong></td>
<td colSpan="2" style="font-family: Arial; font-size: 12px; line-height: 15px">
<strong>N </strong></td>
<td colSpan="2" style="font-family: Arial; font-size: 12px; line-height: 15px">
<strong>RPM </strong></td>
<td>
<strong>Kg </strong></td>
</tr>
<tr style="BACKGROUND-COLOR: #ffffff">
<td>
<strong>open </strong></td>
<td rowSpan="2" style="font-family: Arial; font-size: 12px; line-height: 15px">
<strong>d </strong></td>
<td rowSpan="2" style="font-family: Arial; font-size: 12px; line-height: 15px">
<strong>D </strong></td>
<td rowSpan="2" style="font-family: Arial; font-size: 12px; line-height: 15px">
<strong>B </strong></td>
<td rowSpan="2" style="font-family: Arial; font-size: 12px; line-height: 15px">
<strong>rs min </strong></td>
<td>
<strong>dynamic </strong></td>
<td>
<strong>static </strong></td>
<td>
<strong>Grease </strong></td>
<td>
<strong>oil </strong></td>
<td>
<strong>open </strong></td>
</tr>
<tr>
<td>
<strong>type </strong></td>
<td>
<strong>Cr </strong></td>
<td>
<strong>Cr </strong></td>
<td>
<strong>ZZ , 2RS </strong></td>
<td>
<strong>open </strong></td>
<td>
<strong>type </strong></td>
</tr>
<tr style="BACKGROUND-COLOR: #ffffff">
<td>6000
</td>
<td>10
</td>
<td>26
</td>
<td>8
</td>
<td>0.3
</td>
<td>4550
</td>
<td>1960
</td>
<td>29000
</td>
<td>34000
</td>
<td>0.019
</td>
</tr>
<tr>
<td>6001
</td>
<td>12
</td>
<td>28
</td>
<td>8
</td>
<td>0.3
</td>
<td>5100
</td>
<td>2390
</td>
<td>26000
</td>
<td>30000
</td>
<td>0.021
</td>
</tr>
<tr style="BACKGROUND-COLOR: #ffffff">
<td>6002
</td>
<td>15
</td>
<td>32
</td>
<td>9
</td>
<td>0.3
</td>
<td>5600
</td>
<td>2840
</td>
<td>22000
</td>
<td>26000
</td>
<td>0.030
</td>
</tr>
<tr>
<td>6003
</td>
<td>17
</td>
<td>35
</td>
<td>10
</td>
<td>0.3
</td>
<td>6800
</td>
<td>3350
</td>
<td>20000
</td>
<td>24000
</td>
<td>0.039
</td>
</tr>
</table>