Table

Support Key: [2|3|3.2|4] [X1|X1.1] [IE2|M2A8|N1.1|O2.1]
What is it?
Attributes
Tag Example
Parent/Content Model
Tips & Tricks
Browser Peculiarities
= Index DOT Html by Brian Wilson =
Main Index | Element Tree | Element Index | HTML Support History



   Quick Statistics   
End Tag:
   Required
Standards Details:
In all HTML 4.x/XHTML DTDs
XHTML Modules:
Basic Tables, Tables
CSS 'display' Type:
"table", (also can be considered a block or replaced element in some ways)
CSS Mapping:
Sub-elements map to CSS 'display' properties
Default Rendering:
Tabular content organized by row and then by cell. May have borders or many other display properties specified.
Official Docs:
HTML 4.x, XHTML 1.1

What is it?
This is the top level containing element for HTML table structures. All formatting information lies between the beginning and ending Table tags. By default, tables have no borders. All attributes of the Table element apply globally to each cell in the table unless overridden at a sub-element level (row, cell, etc.) by other attributes.

SOME attributes to the TABLE element are only applicable when the table is constructed using the Complex Table Model which allows a finer level of control than the Simple Table Model while maintaining backward compatibility with the simpler model.

Common Attributes
%Core%
[2|3|3.2|4] [X1|X1.1] [IE3|M|N6B1|O3.5]
%Accessibility%
[2|3|3.2|4] [X1|X1.1] [IE4B1|M|N6|O5]
%Events%
[2|3|3.2|4] [X1|X1.1] [IE4B1|M|N6B1|O4]
%Language%
[2|3|3.2|4] [X1|X1.1] [IE4|M|N6B1|O]
%Data%
[2|3|3.2|4] [X1|X1.1] [IE4|M|N|O]
%Editing%
[2|3|3.2|4] [X1|X1.1] [IE5.5|M|N|O]

Specific Attributes
Align
[2|3|3.2|4] [X1|X1.1] [IE2|M3|N2|O2.1]
Standards Details: Deprecated in HTML 4.x and XHTML 1.0. Dropped in XHTML 1.1 in favor of CSS.
Required? No
Description:
At the Table level this attribute indicates horizontal alignment of the table itself relative to the browser window.
Values: Left | Center | Right
Background
[2|3|3.2|4] [X1|X1.1] [IE3A1|M|N4B3|O5]
Standards Details: NA
Required? No
Description:
This attribute specifies a background image to be used as the backdrop for the table. All cell contents will be displayed over this image. If the referenced image is smaller than the table size, it will be tiled to fit all of the table area.
Values: Either an absolute or relative URL. All URLs should be URL encoded where required.
BGColor
[2|3|3.2|4] [X1|X1.1] [IE2|M|N3B1|O2.1]
Standards Details: Deprecated in HTML 4.x and XHTML 1.0. Dropped in XHTML 1.1 in favor of CSS
Required? No
Description:
Specifies the background color of all the table cells. This value can also be overridden at the cell level.
Values: CDATA. [The standard HTML color specification method values apply.]
Border
[2|3|3.2|4] [X1|X1.1] [IE2|M2A8|N1.1|O2.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
This is an attribute that specifies the size of the border around the table. If the value is 0 or absent, no border is rendered. An additional value of Border can be specified [this is a legacy value that is supported only for backward compatibility with early Table specifications.]
Values: CDATA. [Integers indicating pixel width of the border.]
BorderColor
[2|3|3.2|4] [X1|X1.1] [IE2|M|N4|O]
Standards Details: NA
Required? No
Description:
This attribute sets the external border color to be used for the entire table. Display of this attribute is dependent on the presence of the BORDER attribute in the TABLE element.
Values: The standard HTML color specification methods.
BorderColorDark
[2|3|3.2|4] [X1|X1.1] [IE2|M|N|O]
Standards Details: NA
Required? No
Description:
This attribute allows independent, 3-D color control over the lower and right hand borders of the external border color for the current table. To change the upper and left hand borders of the external cell border color for the current table, use the BorderColorLight attribute (see below.) Display of this attribute is dependent on the presence of the BORDER attribute in the TABLE element.
Values: The standard HTML color specification methods.
BorderColorLight
[2|3|3.2|4] [X1|X1.1] [IE2|M|N|O]
Standards Details: NA
Required? No
Description:
This attribute allows independent, 3-D color control over the upper and left hand borders of the external border color for the current table. To change the lower and right hand borders of the external cell border color for the current table, use the BorderColorDark attribute (see above.) Display of this attribute is dependent on the presence of the BORDER attribute in the TABLE element.
Values: The standard HTML color specification methods.
BottomPadding
[2|3|3.2|4] [X1|X1.1] [IE|M|N4-4.x|O]
Standards Details: NA
Required? No
Description:
This attribute specifies the padding/spacing on the bottom side of the table in pixels.
Values: Positive integers.
CellPadding
[2|3|3.2|4] [X1|X1.1] [IE2|M3|N1.1|O2.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
This specifies globally for all cells in the table the spacing between data in a table cell and the border of the cell.
Values: CDATA. [Integers indicating pixel width of the padding.]
CellSpacing
[2|3|3.2|4] [X1|X1.1] [IE2|M3|N1.1|O2.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
This specifies globally for all cells in the table the spacing between individual cells.
Values: CDATA. [Integers indicating pixel width of the spacing.]
Clear
[2|3|3.2|4] [X1|X1.1] [IE|M|N|O2.1-6.x]
Standards Details: NA
Required? No
Description:
This attribute helps an author in situations with floating objects (images, tables, etc.) produced through the Left and Right ALIGN attributes. It allows content to stop being flowed around the floated element.
Values:
   None [DEFAULT - No special line breaking effects are applied relative to the floating element.]
   Left [breaks line after this element and moves down vertically until the left margin is clear of floated objects.]
   Right [breaks line after this element and moves down vertically until the right margin is clear of floated objects.]
   All [breaks line after this element and moves down vertically until both margins are clear of floated objects.]
Cols
[2|3|3.2|4] [X1|X1.1] [IE3A1|M|N4B2|O]
Standards Details: NA
Required? No
Description:
This Complex Table Model attribute explicitly specifies the number of columns in the table. Using this attribute may allow the browser to dynamically render the table as it is downloaded. If this attribute is absent, it is necessary to receive all of the Table code structure to determine the number of columns and their appropriate widths before display.
Values: Positive integers representing the number of columns listed in the Table HTML content.
Datapagesize
[2|3|3.2|4] [X1|X1.1] [IE4|M|N|O]
Standards Details: In all HTML 4.x DTDs. Dropped in XHTML.
Required? No
Description:
Sets the number of records displayed in a data bound repeated table.
Values: CDATA. [Positive integers]
Frame
[2|3|3.2|4] [X1|X1.1] [IE3A1|M|N6B1|O7.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
This Complex Table Model attribute allows independent control over the outer border display of the table. Using this attribute coupled with the RULES attribute yields much greater border display control than the older Simple Table Model. This attribute takes a single value representing the sides of the outer table border for which to draw borders
Values:
  Void [Do not render any borders]
  Above [Border on top side only]
  Below [Border on bottom side only]
  HSides [Render horizontal borders only (top and bottom sides.)]
  VSides [Render vertical borders only (left and right sides.)]
  LHS [Border on left side only]
  RHS [Border on right side only]
  Box [Border on all four sides]
  Border [Border on all four sides - just like BOX - DEFAULT]
Height
[2|3|3.2|4] [X1|X1.1] [IE2|M|N1.1|O2.1]
Standards Details: NA
Required? No
Description:
Specifies the height of the entire table.
Values: Specified as integer pixel values or a percentage of the browser window height.
HSpace
[2|3|3.2|4] [X1|X1.1] [IE|M|N2|O]
Standards Details: NA
Required? No
Description:
This attribute specifies the horizontal spacing around the table in pixels (left and right padding.)
Values: Positive integers.
LeftPadding
[2|3|3.2|4] [X1|X1.1] [IE|M|N4-4.x|O]
Standards Details: NA
Required? No
Description:
This attribute specifies the padding/spacing on the left side of the table in pixels.
Values: Positive integers.
RightPadding
[2|3|3.2|4] [X1|X1.1] [IE|M|N4-4.x|O]
Standards Details: NA
Required? No
Description:
This attribute specifies the padding/spacing on the right side of the table in pixels.
Values: Positive integers.
Rules
[2|3|3.2|4] [X1|X1.1] [IE3A1|M|N7|O7.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
This Complex Table Model attribute is similar to the FRAME attribute, but where FRAME controls the outer borders around a table, RULES controls the interior dividing line display in a table. Using this attribute coupled with the FRAME attribute yields much greater border display control than the older Simple Table Model.
Values:
  None [No interior borders are displayed]
  Groups [Horizontal borders are displayed between all table groups specified using the THEAD, TBODY, TFOOT and COLGROUP tags.]
  Rows [Horizontal borders are displayed between all table rows (TR)]
  Cols [Vertical borders are displayed between all table columns]
  All [Borders displayed between all table cells]
Summary
[2|3|3.2|4] [X1|X1.1] [IE|M|N6.1|O]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
This attribute aids accessibility for non-visual browsers by providing a summary of the table's purpose and structure.
Values: CDATA. [Alphanumeric characters]
TopPadding
[2|3|3.2|4] [X1|X1.1] [IE|M|N4-4.x|O]
Standards Details: NA
Required? No
Description:
This attribute specifies the padding/spacing on the top side of the table in pixels.
Values: Positive integers.
VSpace
[2|3|3.2|4] [X1|X1.1] [IE|M|N2|O]
Standards Details: NA
Required? No
Description:
This attribute specifies the vertical spacing around the table in pixels (top and bottom padding.)
Values: Positive integers.
Width
[2|3|3.2|4] [X1|X1.1] [IE2|M3|N1.1|O2.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
Specifies the width of the entire table.
Values:
CDATA. [Specified as integer pixel values or a percentage of the available width (eg, the parent table cell width or the browser canvas, etc.)]
Example
[Using the Complex Table Model]
<table border="2" align="left" cellpadding="5" bordercolor="#ff0000"
cols="4" frame="vsides" rules="rows" width="75%">
<caption align="top">Juggling Capabilities of Waterfront Performers</caption>
<thead>
      <tr> <th>Juggler</th> <th>Pins</th> <th>Bowling Balls</th> <th>Flaming Baseballs</th> </tr>
</thead>
<tfoot>
      <tr> <th colspan="4">NOTE: This is only a small sample</th> </tr>
</tfoot>
<tbody>
      <tr> <td>Bob</td> <td>5</td> <td>2</td> <td>5</td> </tr>
      <tr> <td>Larry</td> <td>2</td> <td>7!!!</td> <td>NA</td> </tr>
      <tr> <td>Julie the Great</td> <td>1</td> <td>2</td> <td>20<br> (She IS great!)</td> </tr>
</tbody>
</table>
[Same table using the Simple Table Model]
<table border="2" align="left" cellpadding="5"
bordercolor="#ff0000" width="75%">
      <caption align="top">Juggling Capabilities of Waterfront Performers</caption>
      <tr> <th>Juggler</th> <th>Pins</th> <th>Bowling Balls</th> <th>Flaming Baseballs</th> </tr>
      <tr> <td>Bob</td> <td>5</td> <td>2</td> <td>5</td> </tr>
      <tr> <td>Larry</td> <td>2</td> <td>7!!!</td> <td>NA</td> </tr>
      <tr> <td>Julie the Great</td> <td>1</td> <td>2</td> <td>20<br>(She IS great!)</td> </tr>
      <tr> <th colspan="4">NOTE: This is only a small sample</th> </tr>
</table>
Parent Model
%Block Parent%
Content Model
<caption> | <col> | <colgroup> | <tr> | <thead> | <tbody> | <tfoot>
Tips & Tricks Browser Peculiarities
Boring Copyright Stuff...