Name

table — HTML 4.01 | HTML5

Synopsis

<table> . . . </table>

Indicates a table used for displaying rows and columns of data or information. The minimum elements for defining a table are table for establishing the table itself, tr for declaring a table row, and td for creating table cells within the row. The complete table model is shown below.

Start/End Tags

Required/Required

Attributes

Core, Internationalization, Events, HTML5 Global Attributes

align="left|right|center"

Deprecated. Not in HTML5. 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. Not in HTML5. Specifies a background color for the entire table. The color is specified in hexadecimal RGB values or by color name. Style sheets are the proper way to specify colors.

border="number"

Not in HTML5. 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"

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

cellspacing="number"

Not in HTML5. 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"

Not ...

Get HTML & XHTML Pocket Reference, 4th 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.