How to add space around table border in HTML?

HTMLWeb DevelopmentFront End Technology

To set border spacing for an HTML table, use the CSS border-spacing property. It sets the distance between cells in a table,

Example

You can try to run the following code to add space around table border in HTML

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         table, td, th {
            border: 1px solid black;
            border-spacing: 20px;
            width: 300px;
         }
      </style>
   </head>
   <body>
      <h1>Our Technologies</h1>
      <table>
         <tr>
            <th>IDE</th>
            <th>Database</th>
         </tr>
         <tr>
            <td style="text-align:center">NetBeans</td>
            <td style="text-align:center">MySQL</td>
        </tr>
     </table>
  </body>
</html>
raja
Ali
Published on 01-Feb-2018 07:23:25
Advertisements