This browser does not support basic Web standards, preventing the display of our site's intended design. May we suggest that you upgrade your browser?

HTML Coding

Tables

Note: The HTML pages are out-of-date and will not be updated.

This document serves as a quick reference guide and summary of the HTML codes used in creating tables for web documents. For more information about tables, refer to the Web Publishing Series document on Tables.

return to topBasic Table Codes

On Off Purpose/Explanation
<TABLE> </TABLE> Marks the beginning and end of a table
<TR> </TR> (Table Row code) Marks the beginning and end of a row within a table
<TD> </TD> (Table Data Code) Marks the beginning and end of a cell within a table
<TH> </TH> (Table Heading Code) Marks the beginning and end of a heading cell within the table (formatted as bold and centered)
<CAPTION> </CAPTION> Inserts a caption immediately before or after the table. To place the caption above the table, use ALIGN=TOP within the CAPTION code; to place the caption below the table, use ALIGN=BOTTOM.

return to topTable Code Attributes

The following is a list of attributes that may be used within the TABLE code.

On Off Purpose/Explanation
BORDER=n Adds a border around the cells of the table. You can specify any width for "n." The border around this table is 1.
CELLPADDING=n Adds additional space within the cell, separating the contents of the cell from the border of the table (it doesn't matter if you have selected a visible border or not). The cell padding of this table is 6.
CELLSPACING=n Adds additional space between the cells of the table

return to topAdditional Attributes

The following attributes, unless otherwise indicated, may be used with either the TR or the TD code.

On Off Purpose/Explanation
ALIGN=. . . Aligns the contents of the cell either RIGHT, LEFT, or CENTER within the horizontal margins
VALIGN=. . . Aligns the contents of the cell vertically along the TOP, BOTTOM, or CENTER. The default alignment is CENTER.
WIDTH=n Sets the cell at a specified width. "N" is entered in pixels or as a percentage. For use in TD only.
HEIGHT=n Sets the cell at a specified height. "N" is entered in pixels or as a percentage.
COLSPAN=n Allows the contents of the cell to span horizontally over two or more cells (depending on the number you specify for "n"). This feature is often used for column headings. For use in TD only. See Column Span for a sample table using COLSPAN.
ROWSPAN=n Allows the contents of the cell to span vertically over two or more cells (depending on the number you specify for "n"). For use in TD only. See Row Span for a sample table using ROWSPAN.
Excellence. Our Measure. Our Motto. Our Goal.