HTML <th> rowspan attribute

Definition and Usage

rowspan The attribute defines the number of rows the title cell should span.

Instance

Example 1

HTML table containing a title cell spanning three rows:

<table>
  <tr>
    <th>Month</th>
    <th>Savings</th>
    <th rowspan="3">Holiday Savings!</th>
  </tr>
  <tr>
    <td>January</td>
    <td>¥3000</td>
  </tr>
  <tr>
    <td>February</td>
    <td>¥4000</td>
  </tr>
</table>

Try It Yourself

Example 2

Example 2 using rowspan="0" (for Chrome, Firefox, and Opera):

<table>
<thead>
  <tr>
    <th>Month</th>
    <th>Savings</th>
    <th rowspan="3">Holiday Savings!</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>January</td>
    <td>¥3000</td>
    <td rowspan="0">¥3500</td>
  </tr>
  <tr>
    <td>February</td>
    <td>¥4000</td>
  </tr>
</tbody>
</table>

Try It Yourself

Syntax

<th rowspan="number">

Attribute Value

Value Description
number

Set the number of rows the title cell should span.

Note:rowspan="0" tells the browser to span the cell to the last row of the table section (thead, tbody, or tfoot).

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support