HTML and CSS Reference
In-Depth Information
To create a cell that spans multiple rows or columns, you add the rowspan or colspan
attribute to the <th> or <td> 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:
<!DOCTYPE html>
<title> Row and Column Spans </title>
<table border=“1” summary=“span example”>
<th colspan=“2”> Gender </th>
<th> Male </th>
<th> Female </th>
<td> 15 </td>
<td> 23 </td>
Figure 10.22 shows how this table might appear when displayed.
FIGURE 10.22
Using span
settings to widen
a column.
Note that if a cell spans multiple rows, you don't have to redefine it as empty in the next
row or rows. Just ignore it and move to the next cell in the row. The span fills in the spot
for you.
Search WWH ::

Custom Search