Skip to the content.
Tables
What’s A Table?
- A table represents information in a grid format.
- Examples of tables include financial reports, TV schedules, and sport results.
- Grid allow us to understand complex data by referencing information on two axes.
- Each block in the grid is referred to as a table cell.
- In HTML, a table is written out row by row.
Basic Table Structure
- The <table element is used to create a table. The contents of the table are written out row by row.
- You indicate the start of each row using the opening <tr> tag.
- Each cell of a table is represented using a <td> element.
- The <th> element is used just like the <td> element but its purpose is to represent the heading for either a column or a row.
Long Tables
- The headings of the table should sit inside the <thead> element.
- The body should sit inside the <tbody> element.
- The footer belongs inside the <tfoot> element.