HTML <td> rowspan attribute
Definition and Usage
rowspan
The attribute specifies the number of rows the cell should span.
Example
Example 1
HTML table containing a cell spanning two rows:
<table> <tr> <th>Month</th> <th>Savings</th> <th>Savings during holidays!</th> </tr> <tr> <td>January</td> <td>¥3000</td> <td rowspan="2">¥6000</td> </tr> <tr> <td>February</td> <td>¥4000</td> </tr> </table>
Example 2
Using rowspan="0", the browser will extend the cell to the last row of the table section:
<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">¥6000</td> </tr> <tr> <td>February</td> <td>¥4000</td> </tr> </tbody> </table>
Syntax
<td rowspan="number">
Attribute Value
Value | Description |
---|---|
number |
Specifies the number of rows the 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). Chrome, Firefox, and Opera 12 (and earlier versions) support rowspan="0". |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |