To create a table in HTML, use the <table> tag. A table contains of rows and columns, which can be configured with one or more <tr>, <th>, and <td> elements. A row in the table is defined by the <tr> tag.
Example:
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<td>Rathorji</td>
<td>Rathor</td>
<td>22</td>
</tr>
</table>
Output:
Firstname | Lastname | Age |
---|---|---|
Jill | Smith | 50 |
Eve | Jackson | 94 |
Rathorji | Rathor | 22 |