{"slug": "html-table-borders", "title": "HTML Table Borders", "summary": "HTML table borders can be styled using CSS properties like `border`, `border-collapse`, `border-radius`, `border-style`, and `border-color`. The `border-collapse: collapse` property prevents double borders by merging adjacent borders into a single line. Additionally, borders can be made invisible by matching their color to the background, or rounded using the `border-radius` property.", "body_md": "HTML Table Borders\nHTML tables can have borders of different styles and shapes.\nHow To Add a Border\nTo add a border, use the CSS border property on table, th, and td elements:\nExample:\ntable, th, td {\nborder: 1px solid black;\n}\nCollapsed Table Borders\nTo avoid having double borders like in the example above, set the CSS border-collapse property to collapse.\nThis will make the borders collapse into a single border:\nExample:\ntable, th, td {\nborder: 1px solid black;\nborder-collapse: collapse;\n}\nStyle Table Borders\nIf you set a background color of each cell, and give the border a white color (the same as the document background), you get the impression of an invisible border:\nExample:\ntable, th, td {\nborder: 1px solid white;\nborder-collapse: collapse;\n}\nth, td {\nbackground-color: #96D4D4;\n}\nRound Table Borders\nWith the border-radius property, the borders get rounded corners:\nExample:\ntable, th, td {\nborder: 1px solid black;\nborder-radius: 10px;\n}\nSkip the border around the table by leaving out table from the css selector:\nExample:\nth, td {\nborder: 1px solid black;\nborder-radius: 10px;\n}\nDotted Table Borders\nWith the border-style property, you can set the appearance of the border.\nThe following values are allowed:\nth, td {\nborder-style: dotted;\n}\n** Border Color**\nWith the border-color property, you can set the color of the border.\nExample:\nth, td {\nborder-color: #96D4D4;\n}\nReferences:\nhttps://www.w3schools.com/html/html_table_borders.asp\nhttps://www.geeksforgeeks.org/html/html-table-border-attribute/", "url": "https://wpnews.pro/news/html-table-borders", "canonical_source": "https://dev.to/dev_saravanan_journey/html-table-borders-1jkp", "published_at": "2026-05-22 15:40:26+00:00", "updated_at": "2026-05-22 16:06:28.634083+00:00", "lang": "en", "topics": ["developer-tools", "web3"], "entities": ["W3Schools", "GeeksforGeeks"], "alternates": {"html": "https://wpnews.pro/news/html-table-borders", "markdown": "https://wpnews.pro/news/html-table-borders.md", "text": "https://wpnews.pro/news/html-table-borders.txt", "jsonld": "https://wpnews.pro/news/html-table-borders.jsonld"}}