HTML tables are used to display data in rows and columns. They are created using the <table> element along with rows and cells.
<table> tag, with <tr> for rows, <th> for headers, and <td> for data cells.An HTML table consists of rows and columns. Each row is defined using <tr>, and each cell inside a row is defined using <th> or <td>.
<table>
<tr>
<th>Name</th>
<th>Age</th>
<th>City</th>
</tr>
<tr>
<td>John</td>
<td>25</td>
<td>New York</td>
</tr>
<tr>
<td>Sara</td>
<td>30</td>
<td>London</td>
</tr>
</table>
| Name | Age | City |
|---|---|---|
| John | 25 | New York |
| Sara | 30 | London |
| Tag | Description |
|---|---|
| <table> | Defines the table |
| <tr> | Defines a table row |
| <th> | Defines a header cell |
| <td> | Defines a data cell |
<th> for headings to improve accessibilityCreating a table in HTML is simple and effective for displaying structured data. By using <table>, <tr>, <th>, and <td>, you can organize data into rows and columns.
Proper use of tables improves data presentation and readability.