0

I have a form with a table inside a fieldset.
I want to control the background color of the embedded table, which is a 2 x 3.
I've tried all the fixes I could find on this site and none of them worked.
Specifically,

<style type="text/css">
  .txt {color: darkred; background-color: lightgray;} - this works for a cell
  .table1 {background-color: lightgray;} - this doesn't work for the table
    </style>

<style type="text/css">    
  table{background-color: lightgray;} - this doesn't work for the table
    </style>

I've tried these in a CSS file and as shown above, neither works.

HELP!

Thanks.

Edited by Nick Evan: Fixed formatting

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by $urya
0

Hi there,

Tables background color can be assigned by code as shown below:

<HTML> 
<HEAD> 
<TITLE> Table Background</TITLE> 
<style type="text/css"> 
.tablecolor
{
background-color:lightgrey;
border:1px solid grey;
}
.rowcolor
{
background-color:#ABABAB;
border:1px solid black;
}
BODY { TEXT-DECORATION: none; 
    font-family:verdana; 
    font-size: 9pt; 
    text-indent: 20px; 
} 
</style> 
</HEAD> 
<BODY> 
<center> 
<br><br> 
<table class="tablecolor">
<tr class="rowcolor">
<td>Row1,Column1 </td>
<td>Row1,Column2</td>
<td>Row1,Column3</td>
</tr>
<tr class="rowcolor">
<td>Row2,Column1</td>
<td>Row2,Column2</td>
<td>Row2,Column3</td>
<tr>
</center> 
</BODY> 
</HTML>

I think it might help you in clearing your doubt.

Regards
Surya

0

Your welcome Rick. It's my pleasure if you find it helpful.

Regards
Surya

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.