Example
<table>
<tr><td>alpha</td><td>apple</td></tr>
<tr><td>bravo</td><td>banana</td></tr>
</table>
If I were to hover the mouse over alpha, I would want the background
colour to alpha and apple to change...
I appreciate the help...
tr:hover in your CSS is how to do it. This, uncurprisingly, won't
work in IE6. If you need it to work in IE6 as well then you will need
to investigate a Javascript solution
>Folks,
>I've seen it done (though cannot find an example at the moment) - I
>want a table row background colour to change when any one cell within
>the row has the mouse pointer hovering over it.
>
Put the onmouseover and onmouseout events in the TR tag:
<tr onmouseover="className='class1'" onmouseout="className='class2'">
We use two alternating colors for the background and a third for the
highlight on rollover, so it is more complicated, but that should work
for just highlighting... :-)
--
Kevin Nathan (Arizona, USA)
Linux Potpourri and a.o.l.s. FAQ -- (temporarily offline)
Open standards. Open source. Open minds.
The command line is the front line.
Linux 2.6.25.20-0.5-pae
9:06am up 15 days 23:19, 38 users, load average: 0.15, 0.26, 0.44
> I want a table row background colour to change when any one cell
> within the row has the mouse pointer hovering over it.
tr:hover td { background: yellow }
--
In memoriam Alan J. Flavell
http://groups.google.co.uk/groups/search?q=author:Alan.J.Flavell
Greatly apprecaited... hadn't thought of setting the class in the <tr>
tag! Silly me! And the onmouse event too is a solution that escaped me
though my intranet based application will be firefox based, its
something I will keep in mind!
--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
As CSS provides a mechanism for doing this, I'd tend to prefer the CSS
method. It's not CSS's fault that IE6 doesn't implement it
properly. :) Besides, the more javascript you have on a page the
worse it performs.
If it absolutely must work on IE6, I'd include a javascript for doing
it with the conditional comment mechanism. That way everyone else can
use the CSS approach and only IE6 users get the javascript that nobody
else needs