Specifies an element that arranges its contents into rows and columns.
The table element is commonly used by authors as a layout device.
The advantage of using table elements for layouts:
Several different arrangements can be implemented with table elements.
In most cases, the layout is rendered identically in all commonly used browsers.
In some cases when the width or height attribute of a table element is set in percent,
the rendered size of the table can be different in browsers. In that case, using absolute or static positioned elements can solve the problem.
Elements that belong to a table:
There are three different cluster elements within a table, the tHead (table header), tBody (table body) and the
tFoot (table footer) elements that can be used to create a well formatted data table.
Like every data table, a HTML table element can contain rows (tr) and cells (th, td).
Other elements that can be used with a table:
caption – Inserts a caption to the top or bottom of a table. Every table element may have only one caption element.
col, colGroup elements – Specify rules for one or more table columns in the table, but they are not recommended to use,
because most browsers support these functionalities only partially.
Table elements in action:
The HTML code of this table is implemented in Example 2.
If you want to see the HTML tags by categories, please visit this page.