The cover of The Complete Idiot's Guide to Create a Web Page The Complete Idiot's HTML Tag Reference

| Index | Previous Tag: <SUP> | Next Tag: <TBODY> |


<TABLE>

The container tag for a table structure.

Support:

HTML StandardInternet ExplorerNetscape Navigator
3.0 and later 2.0 and later 1.1 and later
Notes:
  • This tag requires the </TABLE> end tag.
Attributes:
ALIGN = "Text"
The horizontal alignment of the table within the browser window.

Support:

HTML StandardInternet ExplorerNetscape Navigator
3.0 and later 2.0 and later 2.0 and later

Notes:

  • Possible values: LEFT, CENTER, RIGHT.
  • This attribute is deprecated.

BACKGROUND = "Text"
A filename or URL for an image upon which the table text and images will appear.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported 3.0 and later 4.0 and later

Notes:

  • If the image is smaller than the table, the browser will display multiple copies of the image—this is called tiling—so that it fills the entire table.
  • Make sure the image you choose doesn't obscure your table text.

BGCOLOR = "Color value"
The color to use for the table background.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 2.0 and later 3.0 and later

Notes:

  • Use either an RGB value or a color name.
  • Try to use a color that's compatible with the color you're using for your table text.
  • This attribute is deprecated.

BORDER = Postive integer
The size of the table border.

Support:

HTML StandardInternet ExplorerNetscape Navigator
3.0 and later 2.0 and later 1.1 and later

BORDERCOLOR = "Color value"
The color of the table border.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported 2.0 and later 4.0 and later

Notes:

BORDERCOLORDARK = "Color value"
The color of the border on the bottom and right side of the table.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported 2.0 and later Not supported

Notes:

  • Use either an RGB value or a color name.
  • This attribute gives you control over the colors used in creating the border's 3-D effect.

BORDERCOLORLIGHT = "Color value"
The color of the border on the top and left side of the table.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported 2.0 and later Not supported

Notes:

  • Use either an RGB value or a color name.
  • This attribute gives you control over the colors used in creating the border's 3-D effect.

CELLPADDING = Positive integer
The amount of space, in pixels, between a cell's contents and its border.

Support:

HTML StandardInternet ExplorerNetscape Navigator
3.2 and later 2.0 and later 1.1 and later

CELLSPACING = Positive integer
The amount of space, in pixels, between each cell.

Support:

HTML StandardInternet ExplorerNetscape Navigator
3.2 and later 2.0 and later 1.1 and later

CLASS = "Text"
The style sheet class used by the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later Not supported

Notes:

  • You can specify two or more classes; be sure to separate each class name with a space.

COLS = Positive integer
The number of columns in the table.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported 3.0 and later 4.0 and later

DATAPAGESIZE = Positive integer
The number of rows (records) to display in a table that's generated from a database.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported 4.0 and later Not supported

FRAME = "Text"
Determines which of the table's outer borders are displayed.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later Not supported

Notes:

  • Use any of the following values:
    ABOVE    The top border
    BELOW    The bottom border
    BORDER   All four borders
    BOX      All four borders
    HSIDES   Top and bottom borders
    LHS      Left border
    RHS      Right border
    VOID     No borders
    VSIDES   Left and right borders

HEIGHT = Positive integer
The table's height, in pixels or as a percentage.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported 2.0 and later 1.1 and later

ID = "Text"
An alphanumeric string that uniquely identifies the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later Not supported

Notes:

  • Although you can use letters and numbers for the ID, the first character must be a letter.

LANG = "Text"
The language used by the tag's attribute values and text content.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

RULES = "Text"
Determines which of the table's inner borders are displayed.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later Not supported

Notes:

  • Use any of the following values:
    ALL      All inner borders
    COLS     All vertical borders
    GROUPS   Horizontal borders between groups (see <COLGROUP>,
             <TBODY>, <TFOOT>, and <THEAD>)
    NONE     No borders
    ROWS     Horizontal borders

STYLE = "Text"
The style or styles to use with the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later Not supported

Notes:

  • If you enter multiple style properties, separate each one with a semi-colon (;).

SUMMARY = "Text"
A summary of the table's purpose and structure.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later Not supported Not supported

Notes:

  • This attribute will supposedly be used by browsers as an aid for rendering the table to non-visual media (such as speech or Braille).

WIDTH = Positive integer
The table's width, in pixels or as a percentage.

Support:

HTML StandardInternet ExplorerNetscape Navigator
3.0 and later 2.0 and later 1.1 and later

Example:
<TABLE BORDER>
<CAPTION ALIGN=TOP>Table 1. Bernard Lavery's humungofoods.</CAPTION>
<TR>
<TH>Comestible <TH>Size<TH> Year 
<TR>
<TD>Cabbage<TD>124 pounds<TD>1989
<TR>
<TD>Carrot<TD>6 feet, 10 ½ inches<TD>1991
<TR>
<TD>Celery<TD>46 pounds, 1 ounce<TD>1990
<TR>
<TD>Cucumber<TD>20 pounds, 1 ounce<TD>1991
<TR>
<TD>Marrow<TD>108 pounds, 2 ounces<TD>1990
<TR>
<TD>Parsnip<TD>14 feet, 3 ¾ inches<TD>1990
<TR>
<TD>Zucchini<TD>64 pounds, 8 ounces<TD>1990
</TABLE>
How It Looks:
Table 1. Bernard Lavery's humungofoods.
Comestible Size Year
Cabbage124 pounds1989
Carrot6 feet, 10 ½ inches1991
Celery46 pounds, 1 ounce1990
Cucumber20 pounds, 1 ounce1991
Marrow108 pounds, 2 ounces1990
Parsnip14 feet, 3 ¾ inches1990
Zucchini64 pounds, 8 ounces1990

| Index | Previous Tag: <SUP> | Next Tag: <TBODY> |