运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,暗色/亮色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> table, td, th { border: 1px solid black; } #table1 { border-collapse: separate; border-spacing: 10px; } #table2 { border-collapse: collapse; border-spacing: 10px; } </style> </head> <body> <h2>border-collapse: separate</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-collapse: collapse</h2> <p>When using "border-collapse: collapse", the border-spacing property has no effect:</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>