表格隔行换色 css expression

2022-04-15 0 580

第一行为其它颜色,这样写这个表达式

<html><head><meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″><title>表格CSS测试</title><style type=”text/css”><!–tr { background-color: expression(this.sectionRowIndex==0?”#AFAFAF”:((this.sectionRowIndex%2==0) ? “#FFF0F0” : “#F0F0FF”));}–></style></head><body bgcolor=”#FFFFFF” leftmargin=”0″ topmargin=”0″><table cellspacing=”1″> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr></table><p>&nbsp;</p><table cellspacing=”1″> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr> <tr> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> <td width=”50″>&nbsp;</td> </tr></table><p>&nbsp;</p></body></html>

[Ctrl+A 全选 注:引入外部Js需再刷新一下页面才能执行]

比较强的css

<html><head><meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″><title>表格CSS测试</title><style type=”text/css”><!–#DataGrid1 tr { background-color: expression( this.sectionRowIndex == 0 ? “#FFCCCC” : ( (this.sectionRowIndex % 2 == 0) ? “#FFF0F0” : “#F0F0FF” ) ); color: expression(this.sectionRowIndex == 0 ? “#FFFFFF” : “”); font-weight: expression(this.sectionRowIndex == 0 ? “BOLD” : “”); TableSelect: expression( this.sectionRowIndex == 0 ? “” : ( onmouseover = function() { this.style.backgroundColor = ( this.style.backgroundColor != “#69cdff” ? “#69cdff” : ( this.sectionRowIndex == 0 ? “#FFCCCC” : ( this.sectionRowIndex % 2 == 0 ? “#FFF0F0” : “#F0F0FF” ) ) ) }, onmouseout = function() { this.style.backgroundColor = ( this.style.backgroundColor != “#69cdff” ? “#69cdff” : ( this.sectionRowIndex == 0 ? “#FFCCCC” : ( this.sectionRowIndex % 2 == 0 ? “#FFF0F0” : “#F0F0FF” ) ) ) } ) )}#DataGrid1 td { background-color:expression( this.cellIndex == 0 ? ( this.parentElement.sectionRowIndex == 0 ? “#FFCCCC” : “#DDDDDD” ) : null )}.FindAreaTable { font-size: 12px; color: #333333; text-decoration: none; width: 1024px; cursor: hand; background-color: #FFFFFF; vertical-align: middle; text-align: center;}–></style></head><body bgcolor=”#FFFFFF” leftmargin=”0″ topmargin=”0″><table cellspacing=”1″ class=”FindAreaTable” ID=”DataGrid1″> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr></table></body></html>

[Ctrl+A 全选 注:引入外部Js需再刷新一下页面才能执行]

免责声明:
1、本网站所有发布的源码、软件和资料均为收集各大资源网站整理而来;仅限用于学习和研究目的,您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。 不得使用于非法商业用途,不得违反国家法律。否则后果自负!

2、本站信息来自网络,版权争议与本站无关。一切关于该资源商业行为与www.niceym.com无关。
如果您喜欢该程序,请支持正版源码、软件,购买注册,得到更好的正版服务。
如有侵犯你版权的,请邮件与我们联系处理(邮箱:skknet@qq.com),本站将立即改正。

NICE源码网 CSS/HTML 表格隔行换色 css expression https://www.niceym.com/13351.html