Your CSS file mustn't be getting loaded somehow or you have an older version cached in your browser.

Your code works fine. Here it is working in a jsFiddle.

Try performing a hard refresh (generally CTRL+F5 on Windows, CMD+SHIFT+R on Mac) and ensuring your CSS file is located in the same directory as the HTML file you're trying to open.

Answer from Lewis on Stack Overflow
๐ŸŒ
Kompx
kompx.com โ€บ en โ€บ html-table-borders-without-css.htm
HTML table borders without CSS
It is not exactly handling borders themselves, but rather imitating doing it by exploiting the cellspacing and bgcolor attributes. Nowadays, as with HTML centering, this method is perfectly usable, even if CSS border styling is more convenient in most cases.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ html โ€บ how-to-create-table-in-html-with-border-without-css
How to Create Table in HTML with Border without CSS ? - GeeksforGeeks
June 12, 2025 - To add borders to the table without using CSS, we can use the border attribute directly in the <table> tag. The border attribute specifies the width of the border in pixels. Here's how you can add a border to the entire table: <table border="1"> ...
People also ask

Q1. What is the border in HTML?
Ans: Border Table HTML is used to specify a border around your table cells. You can adjust the thickness of your border by providing different values under the
๐ŸŒ
pwskills.com
pwskills.com โ€บ blog โ€บ web development โ€บ border table html โ€“ css, without css, style
Border Table Html - CSS, Without CSS, Style
Q3. How do I add borders in HTML?
Ans: You can use the CSS Style properties to apply different themed borders such as dashed, collapsed, solid, double, dotted in your HTML structure.
๐ŸŒ
pwskills.com
pwskills.com โ€บ blog โ€บ web development โ€บ border table html โ€“ css, without css, style
Border Table Html - CSS, Without CSS, Style
๐ŸŒ
PW Skills
pwskills.com โ€บ blog โ€บ web development โ€บ border table html โ€“ css, without css, style
Border Table Html - CSS, Without CSS, Style
November 4, 2025 - You can adjust the thickness of your border by providing different values under the <table tag. Ans: You can use border properties in the <table tag to apply borders around your table without using the CSS style elements.
๐ŸŒ
Medium
medium.com โ€บ beyond-agile-leadership โ€บ achieve-stylish-html-tables-without-css-border-techniques-and-examples-3e7ff42e1aff
Achieve Stylish HTML Tables without CSS: Border Techniques and Examples | by Sam Turquoise | Beyond Agile Leadership | Medium
July 27, 2024 - So, youโ€™ve been diving into HTML, and now you want to jazz up your tables without getting tangled in the web of CSS? Well, youโ€™re in luck! Today, weโ€™re going to explore how you can create stylish HTML tables using just the good old <table> tag and some nifty border attributes.
๐ŸŒ
W3Schools
w3schools.com โ€บ html โ€บ html_table_borders.asp
HTML Table Borders
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
๐ŸŒ
Htmlhelp
forums.htmlhelp.com โ€บ index.php
Borders In HTML without CSS - HTMLHelp Forums
HTMLHelp.com | HTML Reference | CSS Reference | FAQs | Validator
Find elsewhere
๐ŸŒ
Quora
quora.com โ€บ How-do-I-collapse-a-border-without-CSS-in-HTML
How to collapse a border without CSS in HTML - Quora
Answer (1 of 2): Unfortunately, it is likely that only the last of the three answers I provide is correct. So, you might want to scroll down to the end. THE CSS STYLE MUST BE ADDRESSED Your question is not clear enough to me and I may be mistaken but to collapse a border I assume you want me th...
๐ŸŒ
Quora
quora.com โ€บ How-can-you-border-without-styling-in-CSS
How to border without styling in CSS - Quora
Answer (1 of 3): Check out the code of this table and study it well ! [code]
๐ŸŒ
Screenstepslive
utah.screenstepslive.com โ€บ a โ€บ 1865460-basic-borders-and-line-properties
Basic Borders and Line Properties | Advanced HTML Elements | University of Utah
Adding the Border-style property is an easy way to add visual interest to a border or line. The default border style is solid; other available border-styles include dotted, dashed, double, groove, ridge, inset, and outset.
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ prop_style_border.asp
HTML DOM Style border Property
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ css โ€บ how-to-specify-no-border-in-css
How to Specify no Border in CSS ? - GeeksforGeeks
<html> <head> <style> .box { width: 200px; height: 100px; background-color: lightgreen; border: 2px solid black; } .no-border { border-style: none; } </style> </head> <body> <div class="box">With Border</div> <div class="box no-border">No ...
Published ย  June 28, 2025
๐ŸŒ
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
2 days ago - Use classes for reusable styles: Instead of inline CSS, define classes for different table types to maintain consistency across pages. Consider accessibility: Make sure border contrasts are sufficient for readability, especially for visually impaired users. Test across browsers: CSS rendering may differ slightly between browsers, so verify your tables look consistent everywhere. If you want powerful, interactive tables on your WordPress site without diving into HTML or CSS, wpDataTables is a top-tier solution.
๐ŸŒ
Quackit
quackit.com โ€บ html โ€บ codes โ€บ html_borders.cfm
HTML Borders
To do this, simply copy everything between the style tags and put it into your external style sheet, then replace the style tags with a link tag that points to your external style sheet. Free HTML tutorial that explains how to code in HTML. This tutorial explains what HTML elements and attributes ...
๐ŸŒ
W3Schools
w3schools.com โ€บ css โ€บ css_border.asp
CSS Borders
Note: None of the OTHER CSS border properties (which you will learn more about in the next chapters) will have ANY effect unless the border-style property is set! ... 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 ...
๐ŸŒ
HTML Tables
htmltables.io โ€บ blog โ€บ how-to-create-an-html-table-with-no-border
How to Create an HTML Table With No Border
April 16, 2024 - Check the CSS stylesheets and inline styles to ensure that there are no conflicting styles affecting the table's border. Deprecated Attribute: Although the border attribute is supported in HTML, it is considered deprecated in favor of using CSS for styling.
๐ŸŒ
Bootstrap
getbootstrap.com โ€บ docs โ€บ 4.0 โ€บ utilities โ€บ borders
Borders ยท Bootstrap
Use border utilities to quickly style the border and border-radius of an element. Great for images, buttons, or any other element.
๐ŸŒ
HTML Dog
htmldog.com โ€บ guides โ€บ css โ€บ beginner โ€บ borders
Borders | HTML Dog
Borders can be applied to most HTML elements within the body. To make a border around an element, all you need is border-style.