Table: Row Span

To make a cell span more than one row, use the rowspan attribute with the number of rows to span:

<th rowspan="2">
HTML file: Displayed by browser:
<h2>Telephone Spans 2 Rows</h2>
<table>
  <tr>
    <th>Name:</th>
    <td>Bill Gates</td>
  </tr>
  <tr>
    <th rowspan="2">Telephone:</th>
    <td>555 77 854</td>
  </tr>
  <tr>
    <td>555 77 855</td>
  </tr>
</table>

Telephone Spans 2 Rows

Name: Bill Gates
Telephone: 555 77 854
555 77 855

Notice that <th> and <td> are used in the same row, twice. The <th> cell is automatically centered and done in bold.

Back button Table of Contents Next button