With the introduction of tables came a new dimension to Web pages. Not only do they present data in tabular form but they also give HTML authors control over page layout.
Tables contain:
Table elements are placed between the <TABLE> and the </TABLE> tags. The most common attribute within the table tag is BORDER. Borders are lines around the table which are useful when the table contains data. Borders might not be wanted when the table is used for page layout purposes.
Here is the code for a small table with a caption, two rows, six cells and headings across the top:
<TABLE BORDER=2> <CAPTION>Attendance % For the Month of March </CAPTION> <TR> <TH>Grade 4</TH> <TH>Grade 5</TH> <TH>Grade 6</TH> </TR> <TR> <TD> 97.5%</TD> <TD>98.2%</TD> <TD>97.8%</TD> </TR> </TABLE> |
|
||||||
If the headings are on the left edge of the table make each <TH> the first cell in the row. | |||||||
<TABLE BORDER=2> <CAPTION>Attendance % For the Month of March </CAPTION> <TR> <TH>Grade 4</TH> <TD> 97.5%</TD> </TR> <TR> <TH>Grade 5</TH> <TD>98.2%</TD> </TR> <TR> <TH>Grade 6</TH> <TD>97.8%</TD> </TR> </TABLE> |
|