Entry
How can I use CSS to set HTML TABLE attributes like cellpadding, cellspacing, border, bordercolor?
Aug 8th, 2002 13:51
Randy Harmelink, Jane Jacobs,
Just add CSS attributes to the table's TD tags. For example:
<STYLE>
td
{
border : thick black solid;
color : red;
background-color : yellow;
padding : 10px;
}
table
{
border-collapse : collapse;
}
</STYLE>
<TABLE>
<TBODY>
<TR>
<TD>Col 1, Row 1</TD>
<TD>Col 2, Row 1</TD>
</TR>
<TR>
<TD>Col 1, Row 2</TD>
<TD>Col 2, Row 2</TD>
</TR>
</TBODY>
</TABLE>