skip to contentstylized crane logoWhite Crane Education

Tables

Tables give developers a way to organize data into rows and columns. XHTML's formatting options go way beyond this. The rules and frames attributes give developers (sometimes confusing) control over a table's borders. The col and colgroup tags allow groups of columns to be formatted as units. The thead, tbody and tfoot tags provide a similar functionality for rows. The colspan and rowspan attributes let columns and rows span multiple levels.

Examples

XHTML Output
<table border="1">
  <tr>
    <td rowspan="2">column spanning 2 rows</td>
    <td>row 1, column 2</td>
  </tr>
  <tr>
    <td>row 2, column 2</td>
  </tr>
</table>
column spanning 2 rows row 1, column 2
row 2, column 2
<table border="1">
  <tr><td colspan="2">column spanning 2 rows</td><tr>
  <tr>
    <td>row 2, column 1</td>
    <td>row 2, column 2</td>
  </tr>
</table>
column spanning 2 rows
row 2, column 1 row 2, column 2

Cross-Refrerence