This is the main wrapper for all the other table elements, and other table elements will be ignored if they aren't wrapped inside of a <TABLE> ... </TABLE> element.

The <TABLE> element has the following attributes :

BORDER="value"
This attribute can be used to both control and set the borders to be displayed for the table. If present, then a border will be drawn around all data cells. The exact thickness and display of this default border is at the discretion of individual browsers. If the attribute isn't present, then the border is not displayed, but the table is rendered in the same position as if there were a border (i.e. allowing room for the border). It can also be given a value, i.e. BORDER=<value> which specifies the thickness that the table border should be displayed with. The border value can be set to 0, which regains all the space that the browser has set aside for any borders (as in the case where no border has been set described above)

CELLSPACING="value"
The CELLSPACING is the amount of space inserted between individual table data cells. It defaults to an effective value of 2.

CELLPADDING="value"
The CELLPADDING is the amount of white space between the borders of the table cell and the actual cell data (whatever is to be displayed in the cell). It defaults to an effective value of 1

<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
gives the most compact table possible.

WIDTH="value or percent"
If used, this attribute can specify either the exact width of the table in pixels, or the width of the table as a percentage of the browser display window.

HEIGHT="value or percent"
If used, this attribute can specify either the exact height of the table in pixels, or the height of the table as a percentage of the browser display window.

ALIGN="left|right"
Some browsers (Internet Explorer and Netscape) support the ALIGN attribute to the <TABLE> element. Like that used for floating images, it allows a table to be aligned to the left or right of the page, allowing text to flow around the table. Also, as with floating images, it is necessary to have knowledge of the <BR CLEAR= ...> element, to be able to organise the text display so as to minimise poor formatting.

VALIGN="top|bottom"
The Internet Explorer and Netscape support this attribute that specifies the vertical alignment of the text displayed in the table cells. The default (which is also used if the attribute is not set is centre-aligned.)

BGCOLOR="#rrggbb|colour name"
Internet Explorer and Netscape support use of this attribute (also supported in the <BODY> element). It allows the background colour of the table to be specified, using either the specified colour names, or a rrggbb hex triplet.

BORDERCOLOR="#rrggbb|colour name"
Internet Explorer includes support for this attribute which sets the border colour of the table. Any of the pre-defined colour names can be used, as well as any colour defined by a rrggbb hex triplet. It is necessary for the BORDER attribute to be present in the main <TABLE> element for border colouring to work.

BORDERCOLORLIGHT="#rrggbb|colour name"
Internet Explorer allows use of the BORDERCOLORLIGHT attribute to set independently, the lighter colour to be displayed on a 3-dimensional table border. It is the opposite of BORDERCOLORDARK. Any of the pre-defined colour names can be used, as well as any colour defined by a rrggbb hex triplet. It is necessary for the BORDER attribute to be present in the main <TABLE> element for border colouring to work.

BORDERCOLORDARK="#rrggbb|colour name"
Internet Explorer allows use of the BORDERCOLORDARK attribute to set independently, the darker colour to be displayed on a 3-dimensional table border. It is the opposite of BORDERCOLORLIGHT. Any of the pre-defined colour names can be used, as well as any colour defined by a rrggbb hex triplet. It is necessary for the BORDER attribute to be present in the main <TABLE> element for border colouring to work.

NOTE : The BGCOLOR, BORDERCOLOR, BORDERCOLORLIGHT and BORDERCOLORDARK attributes can also be used in <TH>, <TR> and <TD> elements, with the colour defined in the last element over-riding those defined before. E.g. if a <TD> element contains a BORDERCOLOR attribute setting, the setting specified will be used instead of any colour settings that may have been specified in the <TR> element, which in turn over-rides any colour settings in the <TABLE> element.

BACKGROUND="URL of image"
Internet Explorer supports the placing of images in the <TABLE> element. (Also in the <TD> and <TH> elements) If used in the <TABLE> element, the image in question will be tiled behind all of the table cells. Any of the supported graphic file formats can be used as a graphic behind a table.

FRAME
Only Internet Explorer supports the use of this attribute. It requires the BORDER attribute to be set and affects the display of the table borders. It can accept any of the following values:

voidthis removes all the external borders
abovethis displays external borders at the top of the table only
belowthis displays external borders at the bottom of the table only
hsidesthis displays external borders at the horizontal sides of the table. I.e. at the top and bottom of the table.
lhsthis displays external borders at the left hand edges of the table only.
rhsthis displays external borders at the right hand edges of the table only.
vsidesthis displays external borders at both left and right hand edges of the table.
boxthis displays a box around the table (i.e. top, bottom, left and right hand sides)

RULES
Internet Explorer supports this new attribute. It requires the BORDER value to be set and may only be used in tables where the <THEAD>, <TBODY> and <TFOOT> sections have been set. It affects the display of the internal table borders ("rules"). It can accept the following values:

nonethis removes all the internal rules
basicthis displays horizontal borders between the <THEAD>, <TBODY> and <TFOOT> sections.
rowsthis displays horizontal borders between all rows
colsthis displays horizontal borders between all columns
allthis displays all the internal rules.


Tables Overview Tables Overview <TR>