Web Design

(Nancy Kaufman) #1

166


Create Complex Tables ...........................................


2 Within the table, type <tr>.
3 Press.
4 Type <td colspan=”?”>,
replacing? with the number
of columns you want the cell
to span.
5 Type the contents of the cell.
6 Type </td>.

1 In your editor, open a
document that contains
a table.

Create Complex Tables


S


ometimes, you may need tables that do not follow a simple grid pattern. You may need tables
that have cells that span more than one row or column. You can use the HTML rowspan and

colspan attributes, both of which can be added to table cells, to accomplish this. Both take


as their value an integer representing the number of cells to be spanned. A row that contains


a colspan in one of its cells has a correspondingly lower number of overall cells, whereas a


rowspan results in missing cells from an equal number of rows.


2


5


4 6


1

Free download pdf