Table
] ] ] ]
These are basic tags to create a table.
Table = <TABLE>…</TABLE> |
Each table should be enclosed within this command. |
Table Row = <TR>…</TR> |
Each row in a table is contained by these tags. |
Table Data = <TD>…</TD> |
Table data is contained within this element. By default, table data is shown in a normal font and left justified. |
Table Header = <TH>…</TH> |
These tags are used to create headers, usually in the first row or column of a table. By default, table headers are emphasized and centered. |
<TABLE> |
<TR><TH>…</TH><TH>…</TH></TR> |
<TR><TD>…</TD><TD>…</TD></TR> |
</TABLE> |
<TABLE>…</TABLE>
Border
Borderless = <TABLE>…</TABLE>
Bordered = <TABLE BORDER>…</TABLE>
If you want to indicate the size of the table borders you create, use <TABLE BORDER=number in pixels>.
Alignment
To indicate the alignment of the text on the line, use <TABLE ALIGN=options>. The options can be either LEFT, CENTER or RIGHT.
Cellpadding
To signify the spacing inside the cells, use <TABLE CELLPADDING=number in pixels>.
Cellspacing
To determine the spacing between the cells, use <TABLE CELLSPACING=number in pixels>.
Width
To indicate the width of the table cells, use <TABLE WIDTH=number in pixels> or <TABLE WIDTH=number%>.
Height
To indicate the height of a table, use <TABLE HEIGHT=number in pixels> or <TABLE HEIGHT=number%>.
<TR>…</TR>
Alignment
To indicate the alignment of the text within the columns, use <TR ALIGN=options>. The options can be either LEFT, CENTER or RIGHT. The default is LEFT for table elements and CENTER for table header elements.
Vertical Alignment
To indicate the verticle alignment of the table cells, use <TR VALIGN=options>. The options can be either TOP, MIDDLE, BOTTOM or BASELINE. The default is MIDDLE.
Background Color
To specify the background color for a particular cell, use <TR BGCOLOR=color code> or <TR BGCOLOR=color name>.
<TD>…</TD>
Alignment
To indicate the alignment of the table data, use <TD ALIGN=options>. The options can be either LEFT, CENTER or RIGHT. The default is LEFT.
Vertical Alignment
To indicate the vertical alignment of the table data, use <TD VALIGN=options>. The options can be either TOP, MIDDLE or BOTTOM. The default is MIDDLE.
Row Spanning
To combine a cell with adjacent cells on a row, use <TD ROWSPAN=number of rows to span>.
Column Spanning
To combine across contiguous columns, use <TD COLSPAN=number of columns to span>.
Background Color
To specify the background color for a particular cell, use <TD BGCOLOR=color code> or <TD BGCOLOR=color name>.
<TH>…</TH>
Alignment
To indicate the alignment of the table header, use <TH ALIGN=options>. The options can be either LEFT, CENTER or RIGHT. The default is CENTER.
Vertical Alignment
To indicate the vertical alignment of the table header, use <TH VALIGN=options>. The options can be either TOP, MIDDLE or BOTTOM. The default is MIDDLE.
Row Spanning
To combine a cell with adjacent cells on a row, use <TH ROWSPAN=number of rows to span>.
Column Spanning
To combine across contiguous columns, use <TH COLSPAN=number of columns to span>.
Background Color
To specify the background color for a particular cell, use <TH BGCOLOR=color code> or <TH BGCOLOR=color name>.
<CAPTION>…</CAPTION>
To indicate the table caption, use <CAPTION>…</CAPTION>. Also, if you want to specify the alignment of the table caption, use <CAPTION ALIGN=options>. The options are TOP, if you want to place the table caption above the table, and BOTTOM, if you want to place the table caption below the table. The default is TOP.