Forum Moderators: not2easy

Message Too Old, No Replies

Text colors in CSS styled tables

I need two different ones

         

gotimmy

8:06 pm on Sep 21, 2005 (gmt 0)

10+ Year Member



I've made a table that requires two different text colors per cell. Obviously I want to keep this styling seperate from the HTML, but I cannot work out how to do it.

Sample HTML:

<tr>
<th class="room"><strong>Honeymoon Suite</strong></th>
<td>**the features**</td>
<td><strong>£150<br /> £140</strong></td>
<td><strong>£140<br /> £130</strong></td>
<td><strong>£110<br /> £100</strong></td>
</tr>

Sample CSS:

td {vertical-align: top;}

th {background-color: black;
color: yellow;
}

th.room {background-color: yellow;
color: black;
}

What I want to do is change the second price in the HTML from black to yellow, without introducing a seperate <td>, as the recoloring has to be done within the same cell.

Hope you can help :)

jessejump

8:22 pm on Sep 21, 2005 (gmt 0)

10+ Year Member



span.second { styles....}

<span class="second"> £140 </span>

or just td span {....}

<span>Price</span>

gotimmy

8:27 pm on Sep 21, 2005 (gmt 0)

10+ Year Member



You rock.

Remind me not to drink wine whilst coding...