A table with cell spacing:-
<html>
<head>
<style>
table, th, td {
border: 2px solid black;
padding: 5px;
}
table {
border-spacing: 15px;
}
</style>
</head>
<body>
<h2>Border Spacing</h2>
<p>Border spacing specifies the space between the cells.</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>24</td>
</tr>
<tr>
<td>Jordan</td>
<td>Singh</td>
<td>28</td>
</tr>
</table>
<p>Try to change the border-spacing to 5px.</p>
</body>
</html>
OUTPUT:-
<html>
<head>
<style>
table, th, td {
border: 2px solid black;
padding: 5px;
}
table {
border-spacing: 15px;
}
</style>
</head>
<body>
<h2>Border Spacing</h2>
<p>Border spacing specifies the space between the cells.</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>24</td>
</tr>
<tr>
<td>Jordan</td>
<td>Singh</td>
<td>28</td>
</tr>
</table>
<p>Try to change the border-spacing to 5px.</p>
</body>
</html>
No comments:
Post a Comment