views:

51

answers:

2

Hi,

I am writing a JSP page. I need to have a table. One of the statement is:

where recordTr_SubGroup is in a file style.css

.recordTr_SubGroup {
background-color:#81BEF7; cursor: default; }

I intend to highlight the row with the color. But finally, it happens correctly only in IE8. Firefox, Chrome and Safari cannot produce the same effect for the within the

Anyone can help ?

A: 

My guess is that you have a background colours set on one of the table layers or elements in front of the <tr>, so the other browsers are not showing the tr background colour since it has been effectively papered over. IE is showing it due to some other flaw - possibly it has been nudged into quirks mode.

Check there are no layers in front with a background color, double check the <td> doesn't by setting it to background-color: transparent.

See W3C tables diagram for a description of how background colours should work.

danielgwood
A: 

You should apply a class to each cell, like:

<tr><td class="recordTr_SubGroup"></td><td class="recordTr_SubGroup"></td></tr>

Or change css to following:

tr.recordTr_SubGroup td {background-color:#81BEF7; cursor: default; }
graycrow
<table class="recordTable" width='100%'><tr> <th width='5%' align='left' class="recordTh">No</th></tr><tr class="recordTr_SubGroup"> <td width='5%' align='center' class="recordTd"> <td width='5%' align='center' class="recordTd"> <td width='5%' align='center' class="recordTd"></tr>
SkyEagle888