PNLdev
Tutorial
Front-end
HTML
reference
CSS
reference
JavaScript
reference
En
English
فارسی
En
English
فارسی
Tutorial
Front-end
HTML
reference
CSS
reference
JavaScript
reference
Run
<!DOCTYPE html> <html> <head> <style> table, td, th { border: 5px solid green; } #table1 { border-collapse: separate; border-spacing: 20px; } #table2 { border-collapse: separate; border-spacing: 5px 50px; } </style> </head> <body> <h2>border-spacing: 20px:</h2> <p>When using "border-collapse: separate", the border-spacing property can be used to set the space between the cells:</p> <table id="table1"> <tr> <th>Firstname</th> <th>Lastname</th> </tr> <tr> <td>Peter</td> <td>Griffin</td> </tr> <tr> <td>Lois</td> <td>Griffin</td> </tr> </table> <h2>border-spacing: 5px 50px:</h2> <p>Using two values (the first sets the horizontal spacing and the second sets the vertical spacing):</p> <table id="table2"> <tr> <th>Firstname</th> <th>Lastname</th> </tr> <tr> <td>Peter</td> <td>Griffin</td> </tr> <tr> <td>Lois</td> <td>Griffin</td> </tr> </table> </body> </html>