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:
HTML5 Tags for Web Layouts | ||
---|---|---|
Tag | Function | Html |
div | Define a section in a document | |
nav | Defines navigation links | New |
header | Defines a header for a document or section | New |
footer | Defines a footer for a document or section | New |
aside | Defines content aside from the page content | New |
figure | Specifies diagrams, code listings, etc | New |
canvas | Define graphics | New |
hgroup | Groups a set of <h1> to <h6> elements | New |
section | Define a section in a document | New |
article | Specifies self-contained content | New |
iframe | Define an inline frame | |
table | Specifies a table |