Terry Woods
asked on
Style to set color for table row
I have the following style set up to make the font color red for the row, but it's not changing the color - any ideas why not?
<tr style="color:Red; " onMouseOver="style.background='#ffff77';" onMouseOut="style.background='';">
<td valign="top">Joe Bloggs</td>
...
</tr>
or, better, stay away from inline styles altogether:
<table id="myTable">
<tr onMouseOver.....>
<td>Joe Bloggs</td>
.....
</tr>
....
</table>
<style type="text/css">
table#myTable td { vertical-align:top; color:red; }
</style>
<table id="myTable">
<tr onMouseOver.....>
<td>Joe Bloggs</td>
.....
</tr>
....
</table>
<style type="text/css">
table#myTable td { vertical-align:top; color:red; }
</style>
ASKER
There are more cells in the table row, and I want the whole row to have red text with minimal style code. But not every row is to have red text. If I use a style sheet, will I need to (say) specify a css class for each cell in the rows that need red text?
You could apply a class to each row instead of each cell.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Just what I needed - thanks so much for the quick response!
<tr onMouseOver etc....><td style="vertical-align:top;