Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

Spanning Multiple Rows or Columns 267

10


This cell spans
two rows

This cell spans rows and two columns

This cell spans two columns

To create a cell that spans multiple rows or columns, you add the rowspan or colspan
attribute to the or elements, along with the number of rows or columns you
want the cell to span. The data within that cell then fills the entire width or length of the
combined cells, as in the following example:


Input ▼


<!DOCTYPE html>




Row and Column Spans














Gender
Male Female
15 23



Figure 10.20 shows how this table might appear when displayed.


FIGURE 10.19
Using span set-
tings to alter table
layout.

Free download pdf