TABLES

Tables

The HTML tables allow web authors to arrange data into rows and columns of cells.

  • The HTML table is defined with the<table> tag
  • Each table row is defined with the<tr> tag
  • A table header is defined with the<th> tag
  • A table data/cell is defined with the<td> tag

Example :

<!DOCTYPE html>
<html>
<head>
<title>HTML Tables</title>
</head>
<body>
<table>
<tr>
<th>Name</th>
<th>Place</th>
<th>Age</th>
</tr>
<tr>
<td>John</td>
<td>Bangalore</td>
<td>24</td>
</tr>
<tr>
<td>Smith</td>
<td>Mumbai</td>
<td>26</td>
</tr>
<tr>
<td>Jackson</td>
<td>Mysore</td>
<td>27</td>
</tr>
</table>
</body>
</html>

This will produce the following result −

table-output tag