Merging Table Cells

As you have seen in the preceding sections, every cell in a given row must be the same height, and every cell in a given column must be the same width. You can’t make individual cells different heights or widths, but you can span (merge) two or more adjacent cells so that one cell spans multiple rows and/or columns. This technique is useful for centering text across several columns.

Merging Table Cells

It also comes in very handy when creating table-based page layouts, which you’ll learn about later in this chapter.

To merge a cell into adjacent cells to its right, use the colspan argument and specify the number of columns to be spanned, like this: ...

Get HTML and XHTML Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.