Latest web development tutorials

HTML th rowspan attributes

HTML th tag Reference Manual HTML <th> tag

Examples

The following HTML table contains three rows across a table header cell: An HTML table with 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"
(For more examples, see the bottom of the page)

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support rowspan attribute.

Note: Only Firefox and Opera support rowspan = "0", this value has a special meaning (see below "property values" table).


Definition and Usage

rowspan attribute definition header cell should span the number of rows.


Differences between HTML 4.01 and HTML5

no.


grammar

<th rowspan="number">

Property Value

描述
number 规定表头单元格应该横跨的行数。注意:rowspan="0" 告知浏览器使单元格横跨到表格组件中的最后一个行(thead、tbody 或 tfoot)。


Examples

More examples

rowspan = "0" Use
This example only applies to Firefox and Opera browsers, example demonstrates rowspan = "0" to use.


HTML th tag Reference Manual HTML <th> tag