<table border="1" width="100" height="100">
<tr>
<td width="100%" onmouseover="bgColor='red'" onmouseout="bgColor=''">test</td>
</tr>
</table>
TDobj.style.backgroundColor='red'
TDobj.bgColor='red'
<tr>
<td width="100%" onmouseover="bgColor='red'" onmouseout="bgColor=''">test</td>
</tr>
</table>
TDobj.style.backgroundColor='red'
TDobj.bgColor='red'
<tr>
<td width="100%" onclick="this.style.background='url(csdn.gif)'">test</td>
</tr>
</table>
<tr><td>A<td>B</tr></table>
<input type="button" value="change" onclick="c(0,1,'#0000ff')">
<script>
function c(row,col,color){
tbl.rows[row].cells[col].bgColor=color;
}
</script>
http://expert.csdn.net/Expert/topic/1948/1948456.xml?temp=.9247248
var h=null
function oLight(e){
if(!h)h=e;
h.style.backgroundColor=''
h=e;
h.style.backgroundColor='red'
}
</script>
<table border="1" width="100" >
<tr onclick="oLight(this)">
<td width="100%"> </td>
</tr>
<tr onclick="oLight(this)">
<td width="100%"> </td>
</tr>
<tr onclick="oLight(this)">
<td width="100%"> </td>
</tr>
<tr>
<td width="100%"> </td>
</tr>
</table>
<script>
function oLight(e,flag){
e=e.parentNode.parentNode;
r=document.getElementById('test').rows[e.rowIndex+flag]
temp=e.style.backgroundColor
e.style.backgroundColor=r.style.backgroundColor
r.style.backgroundColor=temp
}
</script>
<table border="1" width="100" id=test>
<tr style="background-color:red">
<td width="100%"><input type=button value="down" onclick="oLight(this,1)"></td>
</tr>
<tr>
<td width="100%"><input type=button value="up" onclick="oLight(this,-1)"><input type=button value="down" onclick="oLight(this,1)"> </td>
</tr>
<tr>
<td width="100%"><input type=button value=up onclick="oLight(this,-1)"><input type=button value=down onclick="oLight(this,1)"> </td>
</tr>
<tr>
<td width="100%"><input type=button value=up onclick="oLight(this,-1)"> </td>
</tr>
</table>
将按钮换为图片