HTML td Tag rowspan Attribute Tutorial

In this section, we will learn what the rowspan attribute is in HTML <td> element and how to use it.

Row Span in HTML Table: What is rowspan Attribute in HTML <td> Tag?

The rowspan attribute is used to set the height of a table data cell in terms of the number of rows.

For example, if we set the value of this attribute to 2, it means the target cell should take up to two rows of the target table.

HTML rowspan Attribute in <td> Tag Syntax:

<td rowspan = “number”> </td>

<td> Tag rowspan Attribute Values

The value we set for the rowspan attribute defines the number of rows the target table data cell should span on.

For example, if the value is set to 3, that means height of the cell should be wide enough to take on 3 rows.

Example: spanning rows in HTML table

See the Pen spanning rows in HTML table by Omid Dehghan (@odehghan) on CodePen.

Leave a Reply