...

View Full Version : Table header problem



Anarchist
03-16-2005, 01:01 AM
I am trying to use CSS to colour the background of certain table header cells, only the ones I want coloured though.

Everything I have tried colours all my header cells..ouch !

Table code:


<tr>
<th>Example1</th>
<th>Example2</th>
<th>Example3</th>
<th>Example4</th>
<th>Example5</th>
<th>Example6</th>
</tr>


My CSS:


BODY {
color: #111111;
background-color: White;
font-family: "Arial Narrow", sans-serif;
font-size: medium;
font-style: italic;
text-align: justify;
}

h1{
border: dotted #DC143C;
}

}

TH{
background-color: green;

}

AaronW
03-16-2005, 01:06 AM
You have an extra } in your CSS, for one.

Secondly, you need a way to select specific cells. A class, for example:


<th class="first">This one is first</th>
<th>This one is normal</th>
<th>This one is normal</th>

Then:


th.first { background-color: #f00; }

That will give the th with a class of "first" a red background, and the others will remain the default colour (white, most likely).

Anarchist
03-16-2005, 01:17 AM
Just what I wanted, sorry about the extra braces, I added that part in a hurry to show what I had tried. :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum