主頁
CSS
CSS 表格
Tryit:使用 border-collapse
執行 ❯
建立您
自己的
網站
×
更改方向
儲存程式碼
更改主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> table, td, th { border: 1px solid; } table { width: 100%; border-collapse: collapse; } </style> </head> <body> <h2>Let the table borders collapse</h2> <table> <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>