i

Learn HTML and CSS in 10 Days

Combining Multiple Cells

Generally, you may need to join two or more cells without breaking the overall column and row layout. To perform this, we take the help of 'rowspan' and 'colspan' attributes. These two attributes can work on either the or element.

The ‘rowspan’ attribute helps in spanning a single cell across multiple rows, while the ‘colspan’ attribute helps in spanning a single cell across multiple columns. Each attribute takes in the integer value that defines the number of cells to span across, and the default value for it is 1.

We can get rid of empty table cells, using the table of books from above, inside the table footer, and clean up the table header.