表格变色范例 - 使用DHTML or Javascript

<table border="0" align="center" cellpadding="5" cellspacing="1" id="alltb">
(一)使用Javascript
在</head>之前
<script language="javascript">
//OnMouse table change backgroundColor
function OMOver(OMO){OMO.style.backgroundColor='#FFCC00';}
function OMOut(OMO){OMO.style.backgroundColor='';}
</script>
含超连结的表格变色
使用Javascript套用单栏
<td bgcolor="#999999" onmouseover="OMOver(this);" onmouseout="OMOut(this);">套用单栏</td>
使用Javascript套用单栏
<td bgcolor="#999999" onmouseover="OMOver(this);" onmouseout="OMOut(this);">套用单栏</td>
使用Javascript正确套用整列(注意bgcolor属性使用位置)
<tr bgcolor="#999999" onmouseover="OMOver(this);" onmouseout="OMOut(this);">
<td>套用整列</td>
<td>套用整列</td>
<td>正确套用(注意bgcolor属性使用位置)</td>
</tr>
套用整列 正确
使用Javascript错误套用整列(注意bgcolor属性使用位置)
<tr bgcolor="#999999" onmouseover="OMOver(this);" onmouseout="OMOut(this);">
<td>套用整列</td>
<td>套用整列</td>
<td bgcolor="#999999">错误套用</td>
</tr>
套用整列 错误
(二)使用自订DHTML - 设定onMouseove & onMouseout
onmouseover="this.style.backgroundColor='#FF0000';" onmouseout="this.style.backgroundColor='#999999';"
(二)使用自订DHTML - 设定onMouseove
onmouseover="this.style.backgroundColor='#0000FF';" onmouseout="this.style.backgroundColor='';"
(二)使用自订DHTMLL - 设定onMouseove & NEW onMouseout
onmouseover="this.style.backgroundColor='#00FF00';" onmouseout="this.style.backgroundColor='#FFFFFF';"
(三)使用自订DHTMLL - 设定整个表格 配合id使用
onmouseover="alltb.style.backgroundColor='#FF00FF';" onmouseout="alltb.style.backgroundColor='';"
<td colspan="2" id="isMe"> ***id有分大小写
(三)使用自订DHTMLL - 配合id使用 隔空喊话
onmouseover="isMe.style.backgroundColor='#CCFF00';" onmouseout="isMe.style.backgroundColor='';"