<TD> rollover

liunx

Guest
I am trying to change the background color of a <td> cell but am getting totally confused. I started to try to use a piece of javascript, but of course it wouldn't work. I tried the following using css:<br />
<br />
<td width="115" onMouseOver="class=altA" onMouseOut="class=altB"><br />
<br />
I also tried <br />
<td width="115" onMouseOver="bgcolor="#CC66FF"" onMouseOut="bgcolor="#999999""><br />
<br />
Also tried<br />
<td width="115" onMouseOver="img1.gif" onMouseOut="img2.gif"><br />
<br />
I also tried a few other things since I am so confused. Can someone point out what I am doing wrong or what other ways I should consider. <br />
<br />
Thanks in advance<!--content-->hi there Lizard,<br />
<br />
try this...:cool: <br />
<br />
<table bgcolor="#999999"onMouseover="this.bgColor='#cc66ff' "<br />
onMouseout="this.bgColor='#999999' " width="115"><br />
<tr><br />
<td>This is background color changer</td><br />
</tr><br />
</table><br />
<br />
coothead<!--content--><td bgcolor="whatever" onMouseOver="this.style='td1'" onMouseOut="this.style='td2'"><br />
<br />
i guess<!--content--><td style="width:115px;" onmouseover="this.style.backgroundColor='#ff9900';" onmouseout="this.style.backgroundColor='#ffff00';"> td contents</td><br />
<br />
both bgcolor and width are deprecated in favour of css :)<!--content-->
 
Back
Top