Click to See Complete Forum and Search --> : Border Color Question for <table>...<td> tags


kwilliams
04-27-2005, 09:53 AM
I just finished updating my entire site with the change from using "bordercolor=#000000" to doing so in a stylesheet with the use of this class:
<style type="text/css">
...
/* Light blue-gray border */
table.bluegrayborder {
border-color:#CCCCCC;
border-style:solid;
border-width:1px
}
...
</style>
...and it works great. But I immediately noticed that the interior cell borders weren't being affected by this new approach, and soon discovered that its because the <td> tags weren't also set with class="bluegrayborder".

So my questions are:
1) Is there a way to have all <td> tags' border color default to the border color class for their <table> tags unless otherwise specified in the <td> tag itself?
2) Or do I now have to go in to each <td> tag for a table containing a border color and set the border colors for them also?

Hope to hear some good avice soon. Thanks in advance.

Fang
04-27-2005, 10:06 AM
table.bluegrayborder ,table.bluegrayborder td {
border-color:#CCCCCC;
border-style:solid;
border-width:1px;
border-collapse:collapse;
}

kwilliams
04-27-2005, 10:19 AM
...worked like a charm. Thanks.

So what is the "border-collapse:collapse;" property about?

Fang
04-27-2005, 11:02 AM
http://www.w3.org/TR/REC-CSS2/tables.html#collapsing-borders