< quick recap >
- Tables can be used to precisely position text and images, and are currently the main instrument to layout web pages.
- Tables are created with the TABLE tag, within them rows with the TR tag, within them cells with the TD tag. Contents are only allowed between TD tags. The right order of these tags is crucial.
- Table and cell size can be set with the WIDTH attribute in pixels and percentages. Specify all sizes, for cells only in the first row.
- Table borders are made visible with the BORDER attribute if its value is larger than zero. Space between the cells is set with the CELLSPACING attribute, space around the cell contents with the CELLPADDING attribute. Set all these values to zero for exact layout of web pages.
- Table and/or cell background colors can be set with the BGCOLOR attribute. If a cell is empty, put a non breakable space ( ) in it to keep the color visible.
- Cell contents can be aligned with the ALIGN attribute to LEFT, CENTER and RIGHT. Vertically they can be aligned with the VALIGN attribute to top middle and bottom. Do not align whole tables, only cells.
- Tables can be nested, but complex and deeply nested tables mean trouble to your browser.
- Never put hard line breaks or spaces between TD tags and images, to prevent unwanted spaces.