ptg16476052
Table Parts 249
10
Start with a simple HTML framework for a page that contains a table. As with all HTML
files, you can create this file in any text editor:
<!doctype html>
Colors
Now start adding table rows inside the opening and closing
tags (where the line
is). The first row is the three head-
ings along the top of the table. The table row is indicated by
and each cell by a
tag:
|
Red |
Yellow |
Blue |
---|
▼
You can format the HTML code any way you want. As with all
HTML, the browser ignores most extra spaces and returns. I like
to format it like this, with the contents of the individual rows
indented and the cell elements on separate lines, so that I can
pick out the rows and columns more easily. But you will often see
tables condensed to just one line of HTML for each row of the
table to save space.
NOTE
Now add the second row. The first cell in the second row is the Red heading on the left
side of the table, so it will be the first cell in this row, followed by the cells for the table
data :
Red |
Red |
Orange |
Purple |
▼