Table


The table tag defines an HTML table. An HTML table consists of the table element and one or more tr and td elements. The th element defines a table header, the tr element defines a table row, and the td element defines a table cell.

Even though it is possible to create nice layouts with HTML tables, tables were designed for presenting tabular data - NOT as a layout tool!

Most websites have put their content in multiple columns (formatted like a magazine or newspaper). Multiple columns are created by using <div> or <table> elements. CSS are used to position elements, or to create backgrounds or colorful look for the pages.

The following tags are commonly used when coding HTML5 and CSS page layouts:

TagFunctionHTML
divDefines a section in a document
navDefines navigation linksNew
header Specifies a header for a document or sectionNew
footerDefines a footer for a document or sectionNew
asideDefines content aside from the page contentNew
figureSpecifies diagrams, code listings, etcNew
canvas Defines graphicsNew
hgroupGroups a set of h1 to h6 elementsNew
article Defines self-contained content New
section Defines a section in a documentNew
iframe Defines an inline frame
tableSpecifies a table