The HTML rowspan attribute
Quick answer
The HTML rowspan attribute makes a table cell span multiple rows. It is used on the <td> and <th> elements.
Overview
The rowspan attribute spans a table cell across rows. It is used on table cells (<th>, <td>) and columns.
It defines table structure — spanning cells across rows or columns, and connecting data cells to their headers. These attributes are central to making data tables understandable to screen-reader users.
Syntax
<td rowspan="2">Spans two rows</td>
Values
| Value |
|---|
| A non-negative integer (0 means span to the end of the section). |
Example
<table border="1"><tr><td rowspan="2">Tall</td><td>1</td></tr><tr><td>2</td></tr></table>
Best practices
Frequently asked questions
What does the rowspan attribute do?
Spans a table cell across rows.