HTML th Tag rowspan Attribute Tutorial

In this section, we will learn what the rowspan attribute is and how to use it.

What is rowspan Attribute in HTML <th> Tag?

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

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

HTML rowspan Attribute in <th> Tag Syntax:

<th rowspan = “value”> </th>

<th> Tag rowspan Attribute Values

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

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

Example: using rowspan attribute in HTML <th> tag

See the Pen using rowspan attribute in HTML <th> tag by Omid Dehghan (@odehghan) on CodePen.

Leave a Reply