Page 1 of 1

naming <td> ?

Posted: Tue Oct 19, 2004 9:26 pm
by sutejok
nigma | Help us, help you. Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

how do i name my <td>s ?

example of what i'm trying to do

Code: Select all

&lt;table&gt;
 &lt;tr&gt;
  &lt;td bgcolor="#FFFFFF"&gt;
    blah
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td onMouseOver=" *want to make the bgcolor of blah to be #CCCCCC* "&gt;
    huhu
  &lt;/td&gt;
 &lt;/tr&gt;
&lt;/table&gt;
how do i do that?

Posted: Tue Oct 19, 2004 9:48 pm
by nigma
You can name your tds with the id attribute. Example:

Code: Select all

<td id="id_name">DATA</td>
If you need help with your JavaScript check out:
http://www.w3schools.com/htmldom/dom_obj_tabledata.asp

Posted: Wed Oct 20, 2004 9:38 am
by vigge89

Code: Select all

<td id='sometable'>data</td>
CSS:

Code: Select all

table td:hover &#123;
    background: #CCC;
&#125;
note: only works "modern" browsers (not IE).
you can make it work by using some hacks though...