Wednesday, January 2, 2019

A table with cell padding

A table with cell padding:- 


<html>
<head>
<style>
table, th, td {
  border: 1px solid black;
  border-collapse: collapse;
}
th, td {
  padding: 15px;
}
</style>
</head>
<body>

<h2>Cellpadding</h2>
<p>Cell padding specifies the space between the cell content and its borders.</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>25</td>
  </tr>
  <tr>
    <td>Jordan</td>
    <td>Singh</td>
    <td>30</td>
  </tr>
</table>

<p>Try to change the padding to 5px.</p>

</body>
</html>

OUTPUT:- 

sk.


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