The rowspan attribute is a hypertext markup language (HTML) feature that enables a table cell in a web page to extend over multiple rows. HTML is one of the main ways in which web pages are created. Typically, a web browser decodes HTML sent by a website and displays the results on a computer screen in a readable format. HTML incorporates the concept of a table to organize the contents on a page.
A table has multiple rows and columns that vertically and horizontally organize information. When displaying an HTML table, one often would like a single content item to apply or spread over multiple rows. In a table, rowspan=N – where N is a number such as 2, 3, etc. – indicates that the cell spreads over that many rows.
Consider an example where sales data is shown as a table with three column headings: the sales region, the person heading the region, and the sales amount. The South region had a change of head during the recording period; the respective amounts are to be attributed to both people. The following code achieves this.