TABLES
The table is one of the most useful HTML constructs.
Tables have two uses: structuring pieces of information and structuring the whole Web
page. Many of the best designed sites on the Internet are based around tables.
<table [align="center"|"left"|"right"] [border ="n"]
[cellpadding="n"][width="nn%"][cellspacing="n"]> ...</table>
Everything between these two tags will be part of the table. These attributes control
the formatting of the table as a whole, not that of the items in each cell. Tables can be
aligned on the screen like most other items, usually they are centered for impact and
clarity. A table can have a border, which includes a border between the cells. If the
border attribute is not set the table has no border. When the border attribute is set
but a valid value is not given, a single pixel wide default border is drawn. For wider
borders you must give a positive integer value.
Everything between these two tags will be part of the table. These attributes control
the formatting of the table as a whole, not that of the items in each cell. Tables can be
aligned on the screen like most other items, usually they are centered for impact and
clarity. A table can have a border, which includes a border between the cells. If the
border attribute is not set the table has no border. When the border attribute is set
but a valid value is not given, a single pixel wide default border is drawn. For wider
borders you must give a positive integer value.
<tr [align="left"|"center"|"right"] [valign="top"|"center"|"bottom"]> ...</tr>
Each row of the table has to be delimited by these tags. The row can be aligned horizontally and
vertically within the table if you want.
<th [align="left"|"center"|"right"] [valign="top"|"center"|"bottom"] [nowrap] [colspan="n"]
[rowspan="n"]>...</th>
The contents of the cell can be aligned vertically and horizontally within their row;
these attributes override any that were set for the row. If nowrap is set, the contents
of the cell will not be automatically wrapped as the table is formatted for the screen.
The colspan and rowspan attributes allow individual cells to be larger than a one by
one grid. It is often useful to have a heading which spans more than one column, Similarly
some data cells may need to be more than one cell deep and rowspan should be used
<td [align="left"|"center"|"right"] [valign="top"|"center"|"bottom"] [nowrap] [colspan="n"]
[rowspan="n"]>...</td>
Advanced Table Elements
<caption>string</caption>
This optional element is used to provide a string which describes the contents of the
table. If used it must immediately follow the table element.
<thead>...</thead>
<tfoot>...<tfoot>
<tbody>...<tbody>
The rows in a table can be grouped into one of three divisions. This grouping is optional. The idea is that
browsers will be able to scroll the tbody section of the table without moving either the thead or tfoot
sections. When long tables extend over
more than one page the information in thead and tfoot can be automatically replicated on each page.
<colgroup [span="n"] [width="n"] >. . .</colgroup>
Columns within a table can be logically grouped together. Each group of columns can
be assigned a default width which will apply to all columns which do not set one of
their own. The span indicates the number of columns in the group.
col [span="n"][width="n"]>...</col>
The attributes of individual columns are set using the col element. The span and
width attributes work in the same way as for the colgroup element.