Để tạo viền gộp trong HTML, hãy dùng thuộc tính CSS border-collapse. Thuộc tính này có các giá trị sau:
| Giá trị | Mô tả |
|---|---|
separate |
Các viền tách biệt (mặc định) |
collapse |
Gộp viền thành một đường viền đơn |
Cách thêm:

Ví dụ: Viền gộp (collapse)
<!DOCTYPE html> <html> <head> <style> table {border-collapse: collapse; } table, td, th { border: 1px solid blue; } </style> </head> <body> <h1>Technologies</h1> <table> <tr> <th>IDE</th> <th>Database</th> </tr> <tr> <td>NetBeans IDE</td> <td>MySQL</td> </tr> </table> </body> </html>
Ví dụ: Viền tách (separate)
<!DOCTYPE html> <html> <head> <style> table { border-collapse: separate; } table, td, th { border: 1px solid blue; } </style> </head> <body> <h1>Technologies</h1> <table> <tr> <th>IDE</th> <th>Database</th> </tr> <tr> <td>NetBeans IDE</td> <td>MySQL</td> </tr> </table> </body> </html>