faqts : Computers : Internet : Web : CSS

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

73 of 108 people (68%) answered Yes
Recently 5 of 10 people (50%) answered Yes

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>