English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Directory

HTML: <th> rowspan attribute

Usage of the rowspan attribute of the <th> tag, the rowspan attribute defines the number of rows the title cell should span, an online instance demonstrates how to use the <th> rowspan attribute, browser compatibility, syntax definition, and detailed information about its attribute values, etc.

 HTML <th> tag

Online Example

An HTML table with a title cell spanning three rows:

<table style="width:100%" border="1">
  <tr>
    <th>Year</th>
    <th>Savings</th>
    <th rowspan="3">Buy a house and save</th>
  </tr>
  <tr>
    <td>2019</td>
    <td>$19320.00</td>
  </tr>
  <tr>
    <td>2020</td>
    <td>$28320.00</td>
  </tr>
</table>
Test it out ‹/›

Browser Compatibility

Attribute




rowspanYesYesYesYesYes

Note:Only Firefox and Opera support rowspan="0", which has a special meaning (see the "Attribute Values" table below).

Definition and Usage

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

HTML 4.01 With HTML5Differences

None.

Syntax

<th rowspan="number">

Attribute Value

ValueDescription
number

Specifies the number of rows the header cell should span.

Note: The attribute rowspan="0" informs the browser to span the cell across to the last row in the table component (thead, tbody, or tfoot).

 HTML <th> tag