Basic structure of a table:
<table>
<tr>
<th>Header1</th> <th>Header2</th>
</tr>
<tr>
<td>Data</td> <td>Data</td>
</tr>
</table>
Output:
| Header1 | Header2 |
|---|---|
| Data | Data |
Colspan attribute is used to merge cells horizontally.
<table>
<tr>
<th colspan="2">Header1</th>
</tr>
<tr>
<td>Data</td> <td>Data</td>
</tr>
</table>
Output:
| Header1 | |
|---|---|
| Data | Data |
Rowspan attribute is used to merge cells vertically.
<table>
<tr>
<th rowspan="2">Header1</th> <th>Header2</th>
</tr>
<tr>
<td>Data</td> <td>Data</td>
</tr>
</table>
Output:
| Header1 | Header2 |
|---|---|
| Data | Data |