...

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



juh915
07-30-2002, 12:11 AM
Hi,
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?


thanks,
Justin

boywonder
07-30-2002, 12:46 AM
Sort of:
You can throw this into your td tag
onmouseover="this.style.backgroundColor='blue';"
(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

juh915
07-30-2002, 12: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,
justin

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum