summary of section 5
Using tables in HTML
Tables are a very important part of HTML, most browsers support them and hence
make a valuable tool for displaying information that would otherwise be complicated
to explain. The points to remember about tables are...
- The <TABLE> tags start and end a table plus specify table with
parameters.
- The <TR> tags start and end a row within a table plus specify
parameters consistent along the row.
- The <TH> tags define a header cell, normally the text here
is by default bold and centred in the cell, you can put any form of HTML inbetween the tags.
- The <TD> tags define a data cell, you can put any form
of HTML inbetween the tags.
- You can force the width of the table to be a specific value by setting the
WIDTH attribute for the table.
- If the above is not defined then the width and height of the table is determined by the widest and
tallest cells in each column and row respectively.
- You can specify a header, body and footer to each table, so when the document is printed it still
make sense. This is done by wrapping particular rows with the <THEAD>
, <TBODY> and <TFOOT> tags.
Tables can also be used to format pages but this is not defined here. How to use tables
for formatting will be explained in more detail elsewhere.
Next: Creating lists in HTML