A table with headings:-
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
}
</style>
</head>
<body>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>AKASH</td>
<td>Jaiswal</td>
<td>20</td>
</tr>
<tr>
<td>ANSH</td>
<td>Rana</td>
<td>24</td>
</tr>
<tr>
<td>JORDAN</td>
<td>Sharma</td>
<td>28</td>
</tr>
</table>
</body>
</html>
OUTPUT:-
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
}
</style>
</head>
<body>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>AKASH</td>
<td>Jaiswal</td>
<td>20</td>
</tr>
<tr>
<td>ANSH</td>
<td>Rana</td>
<td>24</td>
</tr>
<tr>
<td>JORDAN</td>
<td>Sharma</td>
<td>28</td>
</tr>
</table>
</body>
</html>
OUTPUT:-
No comments:
Post a Comment