HTML <th> rowspanProperty

HTML <th> Tag

Example

The following HTML table contains a header cell that spans three rows:

<table border="1"> <tr> <th>Month</th> <th>Savings</th> <th rowspan="3">Savings for holiday!</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table>

Try it Yourself »
(More examples at the bottom of the page)

Browser Support

Property
rowspan Yes Yes Yes Yes Yes

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 a header cell should span.


Differences between HTML 4.01 and HTML5

None.


Syntax

<th rowspan="number">

Property value

Value Description
number Specifies the number of rows a header cell should span.Note:rowspan="0" tells the browser to make the cell span to the last row of the table component (thead, tbody, or tfoot).


实例

More Examples

Use of rowspan="0"
This example only works in Firefox and Opera browsers, and it demonstrates the use of rowspan="0".


HTML <th> Tagother extensions