Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with table colours

0 views
Skip to first unread message

James Brown

unread,
Sep 8, 2003, 5:47:34 PM9/8/03
to
Hi,
I'm still having a problem with colouring table <td> tags:

Without using CSS, I can create a table like this:

<table>
<tr>
<td BGCOLOR="red"> an element </td>
<td BGCOLOR="red"> an element </td>
<td BGCOLOR="red"> an element </td>
</tr>
</table>

This makes every element's background red, but leaves
the table's base background transparent (i.e. the <body>'s
background colour is seen in-between each table element).
This is the effect I want - a visible border between each element.

Now, I posted a question a couple of weeks ago, on how to
do this using CSS. I wanted to apply a css style to a table as a whole,
and have this style effect each table element, without having to manually
colourise each table element. This is what one kind poster offered:

table.td.test
{
background-color: red;
}

<table class="test">
...
</table>


..You get the idea. The problem is, the table's background doesn't
show in-between each table element. Even if I explicitly set the table's
background-color, it does not show - it seems as if the table element's
background has "bled" into the border areas, filling the entire table with
the same colour as each element. Playing with padding and margins
doesn't help. Is there any way to avoid this "glitch"? I'm using I.E 6.0

Cheers,
James


Pascal Chevrel

unread,
Sep 9, 2003, 6:48:18 AM9/9/03
to

table.test td {background-color:red;}

<table class="red">
<tr>
<td> an element </td>
<td> an element </td>
<td> an element </td>
</tr>
</table>


Pascal
--
FAQ Mozilla/Netscape 7 en français : http://pascal.chevrel.free.fr/
Foros Mozilla en español : http://pascal.chevrel.free.fr/mozilla

James Brown

unread,
Sep 9, 2003, 12:58:45 PM9/9/03
to
Nice one!
Thanks alot Pascal, this has been bugging me for ages :-)

Cheers,
James


0 new messages