Table Header

An HTML table contains a set of columns and actual data rows and each row consists of one or more cells, which can be either header or data cells. Header information in a table is defined with the < th > tag.

The < th > element defines a header cell in a table. The < th > elements are contained within a < tr > element , which may also contain < td > elements for data cells.


HTML Source Code :

Most browsers make < th > cells content centered and bold.

HTML Table Caption

A < caption > .. < caption > tag of a Table represents the title of the table, it should tell what the table is about. The caption text should be relatively short, but informative.

The caption element can only be used once per table and must immediately follow the table start tag.


HTML Source Code :

Captions are placed above the table by default. Captions can also be placed below, to the left, or to the right of the table, based on the value of the "align" parameter.

The above HTML code display caption at the bottom of a Table.

The < caption > tag is rarely used even though all major browsers in use these days supports it.