W3Schools
w3schools.com › html › html_table_borders.asp
HTML Table Borders
table, th, td { border: 1px solid black; border-collapse: collapse; } Try it Yourself » · If 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:
W3Schools
w3schools.com › html › tryit.asp
W3Schools online HTML editor
The W3Schools online code editor allows you to edit code and view the result in your browser
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: ...
HTML AM
html.am › html-codes › tables › table-border.cfm
Table Border
Change your HTML table border using these copy/paste HTML codes. Just copy and paste the border code to your own website.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › HTML › Reference › Elements › table
<table>: The Table element - HTML - MDN Web Docs
With CSS, we provide the basic ... data structure clearer. The CSS adds a solid border around the <table> and around each of the table's cells, including those specified with both <th> and <td> elements, demarcating every header and data cells....
W3Schools
w3schoolsua.github.io › html › html_table_borders_en.html
HTML Table Borders. Examples. Tutorial online free. Lessons for beginners. W3Schools in English
This will make the borders collapse into a single border: table, th, td { border: 1px solid black; border-collapse: collapse; } Try it Yourself »
HTML Tables
htmltables.io › blog › html-table-borders
HTML Table Borders — A Complete Guide
April 17, 2024 - If you explore our website, you’ll notice our tables use a soft, gray-ish color for their borders. This is to ensure that the tables remain visually appealing, accessible and don’t come off as brash. In addition to color, HTML tables offer a wide range of border styles to choose from, each with its own unique visual effect and practical application.
TablesGenerator
tablesgenerator.com › html_tables
HTML Tables generator – TablesGenerator.com
Adjust text alignment and table borders using the options from the menu and using the toolbar buttons -- formatting is applied to all the selected cells. Click "Generate" button to see the generated table's HTML source code -- select it and then Copy & Paste to your website's source.
Quackit
quackit.com › html › codes › tables › html_table_border.cfm
HTML Table Border
This page contains HTML table border code - HTML codes for specifying or changing the border of your tables within your blog or web page.
W3Schools
w3schools.com › html › html_tables.asp
HTML Tables
HTML Tables Table Borders Table Sizes Table Headers Padding & Spacing Colspan & Rowspan Table Styling Table Colgroup Code Challenge HTML Lists
Screenstepslive
utah.screenstepslive.com › a › 1864861-table-borders-and-shading
Table Borders and Shading | Advanced HTML Elements | University of Utah
<table style="border-collapse: collapse; width: auto; margin-left: auto; margin-right: auto;" border="1" cellpadding="5"> <caption>Table Caption</caption> <tbody> <tr style="height: 25px; border: 1px solid black;"> <th style="height: 25px; border: 1px solid black;" scope="col">Things</th> <th style="height: 25px; border: 1px solid black;" scope="col">Header 1</th> <th style="height: 25px; border: 1px solid black;" scope="col">Header 2</th> </tr> <tr style="height: 27px; border: 1px solid black;"> <th style="height: 27px; border: 1px solid black;" scope="row">Thing 1</th> <td style="height: 27px; text-align: center; border: 1px solid black; background-color: #708E99;">1</td> <td style="height: 27px; text-align: center; border: 1px solid black;">2</td> </tr> </tbody> </table>
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 way to add borders directly 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.
Hyperskill
hyperskill.org › university › frontend › html-table-borders
HTML Table Borders
October 2, 2024 - To apply a border around the entire table, target the <table> element in your CSS: ... To ensure that individual cells and headers also have borders, target the <th> and <td> elements: ... The border attribute in HTML is a simple way to add borders to an HTML table.
Scientech Easy
scientecheasy.com › home › blog › html table borders
HTML Table Borders - Scientech Easy
February 17, 2026 - The line border-collapse: collapse; removes double borders between the adjacent cells and provides a cleaner look for the table. Now the output will be look something like this in the browser: [blocksy-content-block id=”12121″] Output: ... <!DOCTYPE html> <html> <head> <style> table { border: 2px solid black; /* Adds a solid black border around the table */ border-collapse: collapse; /* Optional: Collapses border to avoid double spacing */ } td, th { border: 1px solid black; /* Adds a solid black border around each cell */ } </style> </head> <body> <table> <tr> <th>Firstname</th> <th>Lastname</th> <th>Age</th> </tr> <tr> <td>John</td> <td>Merry</td> <td>35</td> </tr> <tr> <td>Tripti</td> <td>Priya</td> <td>24</td> </tr> <tr> <td>Jack</td> <td>Herry</td> <td>28</td> </tr> </table> </body> </html>
Top answer 1 of 6
1
table {
border-collapse: collapse;
/* if you don't add this line you will see "double" borders */
border: 1px solid black;
width: 100vw;
}
th{
color: white;
background-color: blue;
}
td{
background-color: white;
width: 70%;
}
td, th {
border: 1px solid black;
}
<section class="Product-Info">
<table>
<tr>
<th colspan="2">Product Infromation</th>
</tr>
<tr>
<th>Product Name:</th>
<td>Name</td>
</tr>
<tr>
<th>Product Description:</th>
<td>Description</td>
</tr>
</table>
</section>
Heres, your snippet!
2 of 6
1
hope it help you
section {
width:100wh;
}
table{
width:100%
}
<section class="Product-Info">
<table border="1">
<tr>
<th colspan="2">Product Infromation</th>
</tr>
<tr>
<td>Product Name:</td>
<td >Name</td>
</tr>
<tr>
<td > Product Description:</td>
<td >Description</td>
</tr>
</table>
</section>