TABLE Borders

Building the TABLE Border

Row 1 duck Cell 3 duck Cell 5
Row 2 duck Cell 4
Row 3
spacer 2

TABLE Borders

The easiest way to define borders is to use the "border" attribute of the <table> element.  Here is a simple two cell table with a border size set at 7 and the color defined by the "style" attribute.  The border color also defines the color of the lines dividing the cells.

Example 1 using the border element

<table border="7" style="border-color:#900">
  <tr>
    <td class="tdheader">Header 1</td>
    <td class="tdheader">Header 2</td>
  </tr>
  <tr>
    <td>row 1, cell 1</td>
    <td>row 1, cell 2</td>
  </tr>
</table>
Header 1 Header 2
row 1, cell 1 row 1, cell 2

Another example with border size set at 4 and the color defined by the "style" attribute.

Example 2 using border element

<table border="4" style="border-color:#00C">
  <tr>
    <td class="tdheader">Header 1</td>
    <td class="tdheader">Header 2</td>
  </tr>
  <tr>
    <td>row 1, cell 1</td>
    <td>row 1, cell 2</td>
  </tr>
</table>
Header 1 Header 2
row 1, cell 1 row 1, cell 2

Previous Page Next Page