Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of CSS border-spacing property</title> <style> table { border-collapse: separate; } table, th, td { border: 1px solid black; } table.one { border-spacing: 25px; } table.two { border-spacing: 10px 20px; } </style> </head> <body> <table class="one"> <tr> <th>Name</th> <th>Email</th> </tr> <tr> <td>John Carter</td> <td>johncarter@mail.com</td> </tr> </table> <p><strong>One-value syntax:</strong> the single value sets the both horizontal and vertical border spacing.</p> <br> <table class="two"> <tr> <th>Name</th> <th>Email</th> </tr> <tr> <td>Peter Parker</td> <td>peterparker@mail.com</td> </tr> </table> <p><strong>Two-value syntax:</strong> the first value sets the horizontal spacing, and the second sets the vertical spacing.</p> <p><strong>Warning:</strong> Internet Explorer 8 supports this property only if a <code>!DOCTYPE</code> is specified.</p> </body> </html>