HTML Tables
HTML Tables
Using HTML tables, we can display the data in the table format.
Using table element and its attributes, we can create table and show the content in
the form of table.
The html tags and attributes to display the content in the form of table are shown
below:
Ex:
<table>
<thead>
<tr>
<th> Name </th>
<th> Age </th>
<th> Married? </th>
</tr>
</thead>
<tbody>
<tr>
<td> Murali </td>
<td> 31 </td>
<td> true </td>
</tr>
<tr>
<td> Kalia </td>
<td> 22 </td>
<td> true </td>
</tr>
<tr>
<td> Raju </td>
<td> 20 </td>
<td> true </td>
</tr>
</tbody>
</table>
output:
rules attribute:
align attribute:
valign attribute:
Ex:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<table frame="box" rules="all" height="300" width="300" >
<thead>
<tr>
<th> Brand </th>
<th> Model </th>
<th> Price </th>
</tr>
</thead>
<tbody align="center" valign="center" >
<tr>
<td> Red Mi </td>
<td> Note 13 </td>
<td> 34,999 </td>
</tr>
<tr>
<td> One Plus </td>
<td> 11R </td>
<td> 27,999 </td>
</tr>
<tr>
<td> One Plus </td>
<td> Nord CE4 </td>
<td> 24,999 </td>
</tr>
</tbody>
</table>
</body>
</html>