Glubase - share your knowledge


All / Computers / Programming / HTML / XHTML





  • View Command

HTML / XHTML Reference

HTML / XHTML table definition

Browser support
IEFFOpSaf
FullFullFullFull

Type: block-level element

Description

This element defines a table. A table consists the following table elements:

Element Description
tr A table row.
td A table cell.
thead / th The table's header.
tbody The table's body.
tfoot The table's footer.
col A column.
colgroup A group of columns.

Attributes

Attribute Description
align Alignment of the table. Deprecated in HTML4. Values: left, center and right.
width The width of the table.
border The width of the border.
cellspacing Space between cells in the table.
cellpadding Space in cells.
bgcolor Background color of table.
summary Purpose of table.
frame [ void | above | below | hsides | lhs | rhs | vsides | box | border ]
rules [ none | groups | rows | cols | all ]

Common attributes.

Example

[Try this example yourself]
<table border="1">
  <tr>
    <th>header 1</th>
    <th>header 2</th>
  </tr>
  <tr>
    <td>cell 1</td>
    <td>cell 2</td>
  </tr>
</table>

Output

header 1 header 2
cell 1 cell 2
  • Comments

No comments added.