CSS Property Value How to - padding: 5px;








Question

We would like to know how to padding: 5px;.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
td {<!--  w  ww  .  j  ava2s . c  om-->
  border: 1px solid black;
}

table.spaced td {
  padding: 5px;
}
</style>
</head>
<body>
  <table class="spaced">
    <tr>
      <td>Cell 1</td>
      <td>Cell 2</td>
    </tr>
  </table>
  <br />
  <p>Spaced with CSS above; Not spaced below</p>
  <br />
  <table>
    <tr>
      <td>Cell 1</td>
      <td>Cell 2</td>
    </tr>
  </table>
</body>
</html>

The code above is rendered as follows: