ⓘ table – table # T
The
table
element
represents a table; that is, data with more than one
dimension.
Permitted contents #
an optional caption element, followed by
zero or more colgroup elements, followed by
an optional thead element, followed by
one tfoot element, followed by
zero or more tbody elements,
or one or more tr elements
or zero or more tbody elements,
or one or more tr elements followed by
an optional tfoot element
Permitted attributes #
- ⓘ
global attributes
- Any attributes permitted globally.
- ⓘ
border = string
#
- Indicates that its
table element
is not being used for layout purposes.
- aria =
#
- (detailed attribute description to come)
Additional constraints and admonitions #
-
The element “table” must not appear as a
descendant of the “caption” element.
-
The “summary” attribute on the
“table” element is obsolete.
Consider describing the structure of the table
in a “caption” element or
in a “figure” element containing
the “table” element; or, simplify
the structue of the table so that no
description is needed.
-
The “align” attribute on the “table” element is obsolete.
Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes
-
The “width” attribute on the “table” element is obsolete.
Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes
-
The “bgcolor” attribute on the “table” element is obsolete.
Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes
-
The value of the “border” attribute on the “table” element
must be either “1” or the empty string. To regulate the thickness of table borders,
Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes
-
The “cellpadding” attribute on the “table” element is obsolete.
Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes
-
The “cellspacing” attribute on the “table” element is obsolete.
Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes
-
The “frame” attribute on the “table” element is obsolete.
Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes
-
The “rules” attribute on the “table” element is obsolete.
Use CSS instead. http://wiki.whatwg.org/wiki/Presentational_elements_and_attributes
Permitted parent elements #
any element that can contain
flow elements
Details #
Although in previous versions of HTML a
table
element was only allowed to contain a
tfoot
element if that
tfoot
occurred before any
tbody
or
tr
elements, but not after, the
table
element is now also alternatively allowed to
contain a
tfoot
after any
tbody
or
tr
elements.
Typical default display properties #
table {
display: table;
border-collapse: separate;
border-spacing: 2px;
border-color: gray; }