> For the complete documentation index, see [llms.txt](https://olise-eke.gitbook.io/frontend-tutorial-for-beginners/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://olise-eke.gitbook.io/frontend-tutorial-for-beginners/overview/html/html-tables.md).

# HTML Tables

HTML tables are a way to display data in a tabular format in HTML documents. They are created using the `<table>` element, along with its related elements such as `<tr>, <th>, <td>,` and `<caption>.`

&#x20;Here is an example of a simple HTML table:

```
<table>
  <caption>Sample Table</caption>
  <tr>
    <th>Header 1</th>
    <th>Header 2</th>
  </tr>
  <tr>
    <td>Row 1, Column 1</td>
    <td>Row 1, Column 2</td>
  </tr>
  <tr>
    <td>Row 2, Column 1</td>
    <td>Row 2, Column 2</td>
  </tr>
</table>
```

&#x20;In this example, the \<table> element defines the table, the \<caption> element defines a caption for the table, the `<tr>` elements define table rows, the `<th>` elements define header cells, and the `<td>` elements define data cells.

&#x20;HTML tables can also be styled using CSS, which provides more control over their appearance and formatting.
