The HTML 5 table tag defines a table in a page.
When Do You Use the table Tag in HTML 5?
The table tag creates a table with columns and rows of data. Within it, there can be many other tags. The ones most commonly used are the caption tag to define a descriptive caption for the table, the thead tag to define a table header section, and within it the th tags to define column headings. More important tags include the tr tags which define table rows, td tags within the rows to define table data, and tbody tag to enclose the main content of the table. There may also be a tfoot tag to enclose a footer for the table. See the example below.
How Is the table Tag Used in HTML 5 Documents?
Here is an example table with the most important related tags.
<table>
<caption>
Boot Size Chart
</caption>
<thead>
<tr>
<th>Size</th>
<th>Boot Size</th>
</tr>
</thead>
<tfoot>
<tr colspan="2">
<td>All boot sizes are shown in inches</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>SM</td>
<td>8</td>
<td>MD</td>
<td>10</td>
<td>LG</td>
<td>12</td>
</tr>
</tbody>
</table>
