HTML tables are used to show information in rows and columns, like a spreadsheet. The main table tag is `<table>`. Inside, rows are created with `<tr>`, and each row has cells made with `<td>` (data cell) or `<th>` (header cell). Tables help display data in a neat and organized way.
Example:
html
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Amit</td>
<td>16</td>
</tr>
</table>
This shows a simple table with names and ages. HTML tables let you show information neatly in rows and columns, similar to an Excel sheet. The main tag is `<table>`, which holds everything. Rows go inside `<tr>`, and each piece of data is inside `<td>`. For headings, use `<th>`. For example:
html
<table>
<tr>
<th>City</th>
<th>Population</th>
</tr>
<tr>
<td>Delhi</td>
<td>19 million</td>
</tr>
</table>
Tables help organize data so it’s clear and easy to read on your webpage.
Join our WhatsApp group for more...
No comments:
Post a Comment