Name

table

Synopsis

<table>...</table>

Indicates a table. The end tag is required, and its omission may cause the table not to render in some browsers.

Attributes

Core(id, class, style, title), Internationalization, Events

align="left|right|center"

Deprecated. Aligns the table within the text flow (same as align in the img element). The default alignment is left. The center value is not universally supported.

bgcolor="#rrggbb" or "color name"

Deprecated. Specifies a background color for the entire table. Value is specified in hexadecimal RGB values or by color name. (See Appendix D for more information on specifying colors in HTML.)

border=" number "

Specifies the width (in pixels) of the border around the table and its cells. Setting its value to 0 (zero) turns the borders off completely. The default value is 1. Adding the word border without a value results in a 1-pixel border, although this is not valid in XHTML.

cellpadding=" number "

Sets the amount of space, in number of pixels, between the cell border and its contents. The default value is 1.

cellspacing=" number "

Sets the amount of space (in number of pixels) between table cells. The default value is 2.

frame="void|above|below|hsides|lhs|rhs|vsides|box|border"

Tells the browser where to draw borders around the table. The values are as follows:

Value

Description

void

The frame does not appear (default).

above

Top side only.

below

Bottom side only.

hsides

Top and bottom sides only.

vsides

Right and left sides ...

Get Web Design in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.