`

表格隔行换色,真是方便,摘自经典论坛

阅读更多
摘自:
http://www.blueidea.com/bbs/NewsDetail.asp?GroupName=Dreamweaver+%26+Javascript%D7%A8%C0%B8&DaysPrune=60&lp=1&id=2232008
 
 
表格隔行换色,节省代码的好方法
<style>
.db { border-collapse:collapse;}
.db tr{ background-color:expression('#F8F8F8,#EFEFEF'.split(',')[rowIndex%2]); }
</style>
<table width="100%" border="1" class="db">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
 
上面是每一行隔行换色每两行一循环,下面是每一行隔行换色,每八行一循环
<style>
.db tr{
background-color:expression('#000000,#333333,#555555,#777777,#999999,#bbbbbb,#dddddd,#ffffff'.split(',')[rowIndex%8]);
}
</style>
分享到:
评论
1 楼 hgq0011 2006-11-03  
这个确实方便

相关推荐

Global site tag (gtag.js) - Google Analytics