<style>
tr{background-color:expression((this.rowIndex%2==0)?"blue":"red");ryo:expression(οnmοuseοver=function(){this.style.backgroundColor=(this.style.backgroundColor!='gray'?'gray':((this.rowIndex%2==0)?"blue":"red"))},οnmοuseοut=function(){this.style.backgroundColor=(this.style.backgroundColor!='gray'?'gray':((this.rowIndex%2==0)?"blue":"red"))})}
</style>
<TABLE width="200" cellpadding="0" cellspacing="2" border="0" id="t1">
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
</TABLE>
很奇怪为什么只有一段代码吧,把代码复制到一个HTML里看看它的运行效果再看看那个样式就知道了。感觉很爽,不过,不知道这个属性是不是底版本一点的浏览器是否支持呢。
tr{background-color:expression((this.rowIndex%2==0)?"blue":"red");ryo:expression(οnmοuseοver=function(){this.style.backgroundColor=(this.style.backgroundColor!='gray'?'gray':((this.rowIndex%2==0)?"blue":"red"))},οnmοuseοut=function(){this.style.backgroundColor=(this.style.backgroundColor!='gray'?'gray':((this.rowIndex%2==0)?"blue":"red"))})}
</style>
<TABLE width="200" cellpadding="0" cellspacing="2" border="0" id="t1">
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
</TABLE>
很奇怪为什么只有一段代码吧,把代码复制到一个HTML里看看它的运行效果再看看那个样式就知道了。感觉很爽,不过,不知道这个属性是不是底版本一点的浏览器是否支持呢。