| Element of Table |
HTML Code |
Example |
|||
| Basic table |
<TABLE> |
|
|||
|
|
<TABLE border=1> |
|
|||
|
|
<TABLE border=1> |
|
|||
| Spanning Cells |
<TABLE border=1> |
|
|||
| Setting alignment within a cell |
<TABLE
border=1> |
|
|||
| Adding a Heading |
<TABLE border=1> |
|
Table Elements |
|
Element |
Description |
| <TABLE> ... </TABLE> | defines a table in HTML. If the BORDER attribute is present, your browser displays the table with a border. |
| <TR> ... </TR> | specifies a table row within a table. You may define default attributes for the entire row: ALIGN (LEFT, CENTER, RIGHT) and/or VALIGN (TOP, MIDDLE, BOTTOM). See Table Attributes at the end of this table for more information. |
| <TH> ... </TH> | defines a table header cell. By default the text in this cell is bold and centered. Table header cells may contain other attributes to determine the characteristics of the cell and/or its contents. See Table Attributes at the end of this table for more information. |
| <TD> ... </TD> | defines a table data cell. By default the text in this cell is aligned left and centered vertically. Table data cells may contain other attributes to determine the characteristics of the cell and/or its contents. See Table Attributes at the end of this table for more information. |
Table Attributes |
|
Attribute |
Description |
| ALIGN (LEFT, CENTER, RIGHT) | Horizontal alignment of a cell. |
| VALIGN (TOP, MIDDLE, BOTTOM) | Vertical alignment of a cell. |
| COLSPAN | The number of columns a cell spans. |
| ROWSPAN | The number of rows a cell spans. |
| NOWRAP | Turn off word wrapping within a cell. |