Monday, January 7, 2019

A table with cell spacing

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:-   



No comments:

Post a Comment

Internal Javascripts

Internal Javascripts :    The script code can be written directly into the HTML document. script code is placed in header of the docume...