Computer >> Computer tutorials >  >> Programming >> HTML

How to add space around table border in HTML?


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

How to add space around table border in HTML?

Example

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

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

Output

How to add space around table border in HTML?