HTML Table content Cheat Sheet

<caption> … </caption>The HTML Table Caption element (<caption>) specifies the caption (or title) of a table, and if used is always the first child of a <table>.
<table> … </table>The HTML <table> element represents tabular data — that is, information presented in a two-dimensional table comprised of rows and columns of cells containing data.
<tbody> … </tbody>The HTML Table Body element (<tbody>) encapsulates a set of table rows (<tr> elements), indicating that they comprise the body of the table (<table>).
<td> … </td>The HTML <td> element defines a cell of a table that contains data. It participates in the table model.
<tfoot> … </tfoot>The HTML <tfoot> element defines a set of rows summarizing the columns of the table.
<th> … </th>The HTML <th> element defines a cell as header of a group of table cells. The exact nature of this group is defined by the scope and headers attributes.
<thead> … </thead>The HTML <thead> element defines a set of rows defining the head of the columns of the table.
<tr> … </tr>The HTML <tr> element defines a row of cells in a table. The row’s cells can then be established using a mix of <td> (data cell) and <th> (header cell) elements.

Example

<table>
<thead>
<tr>
<th colspan="2">The table header</th>
</tr>
</thead>
<tbody>
<tr>
<td>The table body</td>
<td>with two columns</td>
</tr>
</tbody>
</table>

Leave a Reply

Your email address will not be published. Required fields are marked *