在单元格< td>标记中加入以下代码,会动态改变单元格的颜色设置:
onMouseOut=”this. bgColor=’’” onMouseOver=”this.bgColor=’’”
在行标签< tr>标记中加入上面代码,会动态改变一行的颜色设置。
〈table width="50%" border="0" cellspacing="1" bgcolor="#000000">
< tr bgcolor="#FFFFFF" onMouseOver="this.bgColor='#00CC00'" onMouseOut="this.bgColor='#FFFFFF'">
< td> < /td>
< td> < /td>
< /tr>
< tr bgcolor="#FFFFFF">
< td onMouseOver="this.bgColor='#FFFF00'" onMouseOut="this.bgColor='#FFFFFF'"> < /td>
< td onMouseOver="this.bgColor='#FFFF00'" onMouseOut="this.bgColor='#FFFFFF'"> < /td>
< /tr>
< /table〉