HTML tables are used to display data in a structured format using rows and columns.
They are commonly used for reports, records, schedules, and comparison data.
An HTML table is made up of rows, and each row contains cells.
<table>
<tr>
<th>Header</th>
<th>Header</th>
</tr>
<tr>
<td>Data</td>
<td>Data</td>
</tr>
</table>
<table>...</table>
<tr>...</tr>
<th>Name</th>
<td>Table data</td>
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
<th>Course</th>
</tr>
<tr>
<td>Ashutosh</td>
<td>22</td>
<td>CSE</td>
</tr>
<tr>
<td>Rahul</td>
<td>21</td>
<td>IT</td>
</tr>
</table>

A table with 3 columns and 3 rows, clearly showing student data.
rowspan is used to merge two or more rows into one cell.
<td rowspan="2">Value</td>
<table border="1">
<tr>
<th>Name</th>
<th>Subject</th>
</tr>
<tr>
<td rowspan="2">Ashu</td>
<td>Math</td>
</tr>
<tr>
<td>Science</td>
</tr>
</table>
Explanationcolspan is used to merge two or more columns into one cell.
<td colspan="2">Value</td>
<table border="1">
<tr>
<th>Name</th>
<th colspan="2">Marks</th>
</tr>
<tr>
<td>Ashu</td>
<td>45</td>
<td>48</td>
</tr>
</table>

| Rowspan | Colspan |
|---|---|
| Merges rows | Merges columns |
| Vertical merge | Horizontal merge |
| Uses rowspan | Uses colspan |