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 »
🌐
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".
🌐
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.
🌐
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 }
🌐
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.
🌐
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....
Find elsewhere
🌐
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.
🌐
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.
🌐
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
December 15, 2025 - 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> ...
🌐
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>
🌐
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.
🌐
DhiWise
dhiwise.com › post › the-ultimate-guide-to-html-table-border-styling
Elevate Your Website with Modern HTML Table Border ...
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.
🌐
GeeksforGeeks
geeksforgeeks.org › html › html-table-borders
HTML Table Borders - GeeksforGeeks
July 23, 2025 - Example: Illustration of the creation of an HTML Table with a Border. ... <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>HTML Table border</title> <style> body { font-family: Arial, Helvetica, sans-serif; } h1, h3 { text-align: center; color: green; } table { width: 100%; border: 1px solid #100808; } th, td { border: 1px solid #eca0a0; padding: 10px; text-align: center; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h3>Table with border </h3> <table> <thead> <tr> <th>Name</th> <th>Class</th> <th> Roll No </th> </tr> </thead> <tbody> <tr> <td>Mahima</td> <td>10</td> <td>1</td> </tr> <tr> <td>Krishn</td> <td>8</td> <td>3</td> </tr> <tr> <td>Shivika</td> <td>8</td> <td>5</td> </tr> </tbody> </table> </body> </html>
🌐
Scaler
scaler.com › home › topics › html table borders
HTML Table Borders - Scaler Topics
June 24, 2024 - HTML <table> border attribute comes with simple syntax, allowing the specification of border width using values "1" or "0."
🌐
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: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · 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
Top answer
1 of 4
16

Use border-collapse: collapse

table {
    border-collapse: collapse;
}

The border-collapse property sets whether the table borders are collapsed into a single border or detached as in standard HTML.

table {
    border-collapse: collapse; 
    border:1px solid #69899F;
} 
table td{
    border:1px dotted #000000;
    padding:5px;
}
table td:first-child{
    border-left:0px solid #000000;
}
table th{
   border:2px solid #69899F;
   padding:5px;
}
<table class="table table-bordered">
   <thead>
  <tr>
     <th>Sr No</th>
     <th>Product Name</th>
     <th>Quantity</th>
     <th>Add</th>
  </tr>
   </thead>
   <tbody class="allign-center">
  <tr>
     <td>1</td>
     <td class="proname">MARHABA SAFOOF TABKHIR</td>
     <td><input class="qty" type="number"></td>
     <td><button class="btn btn-xs btn-success" onclick=""><i class="fa fa-arrow-right"></i>Add</button></td>
  </tr>
  <tr>
     <td>2</td>
     <td class="proname">MARHABA JAWARISH SHAHI AMBRI</td>
     <td><input class="qty" type="number"></td>
     <td><button class="btn btn-xs btn-success" onclick=""><i class="fa fa-arrow-right"></i>Add</button></td>
  </tr>
  <tr>
     <td>3</td>
     <td class="proname">MARHABA JAWARISH ZAROONI SADA</td>
     <td><input class="qty" type="number"></td>
     <td><button class="btn btn-xs btn-success" onclick=""><i class="fa fa-arrow-right"></i>Add</button></td>
  </tr>
  <tr>
     <td>4</td>
     <td class="proname">MARHABA SAFOOF HAZAM</td>
     <td><input class="qty" type="number"></td>
     <td><button class="btn btn-xs btn-success" onclick=""><i class="fa fa-arrow-right"></i>Add</button></td>
  </tr>
   </tbody>
</table>

2 of 4
3

Maybe this is what you're looking for. Give it a shot.

 table {
border:1px solid #CCC;
border-collapse:collapse;
}
td {
border:none;
}
<table class="table table-bordered">
   <thead>
  <tr>
     <th>Sr No</th>
     <th>Product Name</th>
     <th>Quantity</th>
     <th>Add</th>
  </tr>
   </thead>
   <tbody class="allign-center">
  <tr>
     <td>1</td>
     <td class="proname">MARHABA SAFOOF TABKHIR</td>
     <td><input class="qty" type="number"></td>
     <td><button class="btn btn-xs btn-success" onclick=""><i class="fa fa-arrow-right"></i>Add</button></td>
  </tr>
  <tr>
     <td>2</td>
     <td class="proname">MARHABA JAWARISH SHAHI AMBRI</td>
     <td><input class="qty" type="number"></td>
     <td><button class="btn btn-xs btn-success" onclick=""><i class="fa fa-arrow-right"></i>Add</button></td>
  </tr>
  <tr>
     <td>3</td>
     <td class="proname">MARHABA JAWARISH ZAROONI SADA</td>
     <td><input class="qty" type="number"></td>
     <td><button class="btn btn-xs btn-success" onclick=""><i class="fa fa-arrow-right"></i>Add</button></td>
  </tr>
  <tr>
     <td>4</td>
     <td class="proname">MARHABA SAFOOF HAZAM</td>
     <td><input class="qty" type="number"></td>
     <td><button class="btn btn-xs btn-success" onclick=""><i class="fa fa-arrow-right"></i>Add</button></td>
  </tr>
   </tbody>
</table>