A table with collapsed borders:-
<html>
<head>
<style>
table, th, td {
border: 2px solid black;
border-collapse: collapse;
}
</style>
</head>
<body>
<h2>Collapsed Borders</h2>
<p>If you want the borders to collapse into one border, add the CSS border-collapse property.</p>
<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>23</td>
</tr>
<tr>
<td>Jordan</td>
<td>Singh</td>
<td>30</td>
</tr>
</table>
</body>
</html>
<html>
<head>
<style>
table, th, td {
border: 2px solid black;
border-collapse: collapse;
}
</style>
</head>
<body>
<h2>Collapsed Borders</h2>
<p>If you want the borders to collapse into one border, add the CSS border-collapse property.</p>
<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>23</td>
</tr>
<tr>
<td>Jordan</td>
<td>Singh</td>
<td>30</td>
</tr>
</table>
</body>
</html>
OUTPUT:-
No comments:
Post a Comment