HTML tables are used to display data in rows and columns. They help organize information in a structured format.
An HTML table is created using the <table> tag. Rows are defined using
<tr>, header cells using <th>, and data cells using
<td>.
<table border="1">
<tr>
<th>S.No</th>
<th>Name</th>
<th>Roll No</th>
</tr>
<tr>
<td>1</td>
<td>Ritesh</td>
<td>234</td>
</tr>
<tr>
<td>2</td>
<td>Firoz</td>
<td>456</td>
</tr>
</table>
Defines the complete table.
Defines a table row.
Defines a table header cell.
Defines a table data cell.
The <caption> tag provides a title for the table.
<table> <caption>Student List</caption> </table>
The colspan attribute allows a cell to span multiple columns.
<td colspan="2">Combined Cell</td>
The rowspan attribute allows a cell to span multiple rows.
<td rowspan="2">Data</td>
Which tag is used to create a table row?