View Full Version : changing background colors of a <td>

07-30-2002, 01:11 AM
Can somebody help me with changing the background color of a table cell (<td>)? I'm not sure how to do it.

I would like to be able to rollover the table cell and have it change colors. I imagine that this would be possible using a onMouseOver. Is there any more JS required other than that single attribute?


07-30-2002, 01:46 AM
Sort of:
You can throw this into your td tag
(use the same with onmouseout to change it back)

However this won't work in NS4, you'll need to deal with layers to get the same effect. Search around http://www.javascriptkit.com . There was a tutorial there for exactly that. That is if your one of those people who still cares about NS4 :)
hope that helps

07-30-2002, 01:47 AM
hey thanks a lot!

now I have another problem...how do i get that table cell to be able to link to another page. So not only is the text in the cell a link, but rather the whole cell is a link.

i can't just put an href tag in the <td> tag can I?

thanks again,

07-30-2002, 02:21 AM
<td style="cursor:hand;" onclick="window.location='URL'">