That's an old way of placing a border around the table. The better way to place a border around a table and cells is by using CSS:

​table, td {
    border-collapse: separate;
    border: 1px solid #999;
}​

jsFiddle example

Answer from j08691 on Stack Overflow
🌐
W3Schools
w3schools.com › html › html_table_borders.asp
HTML Table Borders
table, th, td { border: 1px solid black; border-collapse: collapse; } Try it Yourself »
🌐
GeeksforGeeks
geeksforgeeks.org › html › html-table-border-attribute
HTML table border Attribute - GeeksforGeeks
July 11, 2025 - Alternatively, setting the border attribute to "0" removes the borders entirely. ... The value represents the thickness of the border in pixels. border="1": This means the table will have a border of 1 pixel.
🌐
HTML AM
html.am › html-codes › tables › table-border.cfm
Table Border
You can get a quick border around your table by using the HTML border attribute. You determine the width of the border using a number. For example, for a thin border, use the number "1".
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › api › system.web.ui.htmlcontrols.htmltable.border
HtmlTable.Border Property (System.Web.UI.HtmlControls) | Microsoft Learn
The width (in pixels) of the border of an HtmlTable control. The default is -1, which indicates that the border width is not set.
🌐
Ionic Framework
forum.ionicframework.com › ionic-v1
[SOLVED] Html table border - ionic-v1 - Ionic Forum
October 4, 2017 - The top of my html code is table style="border-color: #000000; width: 100%; margin-left: auto; margin-right: auto;" border="1" cellspacing="0" cellpadding="0" But the black border is not appearing on my tables.
🌐
Advancedhtml
advancedhtml.co.uk › tables.htm
Tables in HTML
Advanced HTML HTML Tables HTML Frames HTML Colours Basic HTML Tags · Buying Webspace Search Engines Making Money Website Analytics
🌐
W3C
w3.org › Style › Tables › examples.html
Examples of table borders and rules
Corresponds to HTML3 rule=all, border=1. ... The second example from the HTML3 spec. (interpreted from the ASCII graphics). table { border-top: double; border-bottom: double; border-right: blank } thead, tbody, tfoot { border-top: solid; border-bottom: solid } colgroup { border-right: solid }
Find elsewhere
🌐
W3Schools
w3schools.com › css › css_table.asp
CSS Styling Tables
If you just want a border around the table (not inside), you specify the border property only for the <table> element: ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected] · If you want to report an error, or if you want to make a suggestion, send us an e-mail: [email protected] · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
HTML.com
html.com › attributes › table-border
Table Border: The Old (HTML) And New (CSS) Code Compared »
September 26, 2019 - The table border attribute could accept two values: 0 for no borders and 1 to display borders around table cells. Simple as that. However, the attribute has been deprecated in favor of table borders styled with CSS.
🌐
W3Docs
w3docs.com › html
How to Add Border to HTML Table
<!DOCTYPE html> <html> <head> <title>Title of the document</title> </head> <body> <table border="1"> <tr> <th>Person</th> <th>Age</th> </tr> <tr> <td>Ann</td> <td>19</td> </tr> <tr> <td>Susie</td> <td>22</td> </tr> </table> </body> </html>
🌐
W3Schools
www-db.deis.unibo.it › courses › TW › DOCS › w3schools › tags › att_table_border.asp.html
HTML table border Attribute
The following HTML table will be ... <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » · The border attribute specifies if a border should be displayed around the table cells or not....
🌐
Quackit
quackit.com › html › codes › tables › html_table_border.cfm
HTML Table Border
To set the border of an HTML table, use the CSS border property.
🌐
Dot Net Tutorials
dotnettutorials.net › home › table borders in html
Table Borders in HTML with Examples - Dot Net Tutorials
November 18, 2021 - <!DOCTYPE html> <html> <head> <style> ... </tr> </table> </body> </html> To border around the table and cells we have used CSS border property....
🌐
ETSU Faculty
faculty.etsu.edu › tarnoff › ntes1710 › tables › tables.htm
HTML Table Basics
The resulting table is shown below. Note that I had to add the "border=1" attribute to define the cells of the table with lines.
🌐
EDUCBA
educba.com › home › software development › software development tutorials › html tutorial › table border in html
Table Border in HTML | 10 Ways for Defining Table Border with Examples
July 13, 2022 - The table border in HTML is set by assigning value 1 to display a border around the table, whereas 0 to hide a border around the table.
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
Screenstepslive
utah.screenstepslive.com › a › 1864861-table-borders-and-shading
Table Borders and Shading | Advanced HTML Elements | University of Utah
<table style="border: 1px solid; max-width: 100%; min-width: 40%; margin: 1.5rem auto; float: right;"> <caption>Table with Shaded Column</caption> <colgroup> <col style="border: 1px solid;" /> <col style="border: 1px solid;" /> <col style="border: 1px solid; background-color: #708E99;" /> ...
🌐
wpDataTables
wpdatatables.com › home › blog › html table borders: the complete guide to creating, styling, and customizing
HTML Table Borders: The Complete Guide to Creating, Styling, and Customizing
3 weeks ago - The border attribute is the simplest ... in HTML. It’s easy to implement but limited in customization. ... In the blink of an eye, borders appear. A straightforward approach — like grabbing the first pencil you see. This method quickly adds visible borders to each table cell. However, it doesn’t allow advanced styling such as color, thickness, or spacing adjustments. For more control, CSS is recommended. <table border="1"> <tr> ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › HTML › Reference › Elements › table
<table>: The Table element - HTML | MDN
November 7, 2025 - Defines the size of the space between two cells. This attribute is obsolete: instead of using it, set the border-spacing CSS property on the <table> element.
🌐
DhiWise
dhiwise.com › post › the-ultimate-guide-to-html-table-border-styling
Elevate Your Website with Modern HTML Table Border Styling
June 4, 2024 - This example creates a table with a simple single border around each cell and around the whole table. The border="1" attribute indicates a border width of 1 pixel.