An HTML table is useful when you want to show information in rows and columns. This example has three columns and five rows: one header row and four data rows.
HTML Table Code
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
<th>City</th>
</tr>
<tr>
<td>Emma</td>
<td>24</td>
<td>Amsterdam</td>
</tr>
<tr>
<td>Liam</td>
<td>29</td>
<td>London</td>
</tr>
<tr>
<td>Sofia</td>
<td>31</td>
<td>Madrid</td>
</tr>
<tr>
<td>Noah</td>
<td>27</td>
<td>Berlin</td>
</tr>
</table>
How It Works
The <table> tag creates the table. Each <tr> tag creates a row. Use <th> for the headings and <td> for normal table cells.
Result
| Name | Age | City |
|---|---|---|
| Emma | 24 | Amsterdam |
| Liam | 29 | London |
| Sofia | 31 | Madrid |
| Noah | 27 | Berlin |
You can replace the example names, ages, and cities with your own information.
