With border-collapse set to collapse, the solution would be to use an inset border for all the cells, and a solid border for the cell that the mouse hovers over. Here's the suggested CSS in action: http://jsfiddle.net/QmHGG/

The following is the CSS that was applied to the table:

table, tr, td {
    border: 1px inset black;
    border-collapse: collapse;
    border-spacing: 0;
}

td:hover {
    border: 1px solid red;
}
Answer from Dr. Nitin Reddy Katkam on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ html โ€บ html_table_borders.asp
HTML Table Borders
This will make the borders collapse into a single border: 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 ...
Discussions

CSS code for table borders
What is css code to change all table borders to black? More on forums.knack.com
๐ŸŒ forums.knack.com
0
June 5, 2024
Change TD border color with HTML or CSS - Stack Overflow
I have a little trouble with changing one tr border color My table is something like this ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
how can i change color of vertical and horizontal border on a table in css?
This will do it: https://codepen.io/NeilSchulz/pen/gOoXRpj (Notes in HTML and CSS explaining steps) More on reddit.com
๐ŸŒ r/csshelp
3
1
April 2, 2022
Override Table border
https://jsfiddle.net/zee1aLsj/4/ your "table .noborder" is targeting an element with a class of noborder inside of a table, that's why the border remains on the table element. Change to just .noborder or table.noborder (if you need to be more specific for some reason) and it works. More on reddit.com
๐ŸŒ r/css
4
1
February 12, 2015
๐ŸŒ
W3Schools
w3schools.com โ€บ css โ€บ css_border_color.asp
CSS Border Color
CSS Reference CSS Selectors CSS ... Color Values CSS Default Values CSS Browser Support ... The border-color property is used to set the color of the four borders....
๐ŸŒ
HTML.com
html.com โ€บ attributes โ€บ table-bordercolor
What Does HTML Bordercolor Attribute Does To Your Tables? [Clue: Color!] ยป
December 20, 2019 - First, weโ€™ll look at setting the borders to a single color. Next, weโ€™ll look at setting the light and dark shades of the border. The color of the table borders as a whole is set with the BORDERCOLOR attribute of the <TABLE> tag.
๐ŸŒ
Wrox
p2p.wrox.com โ€บ css-cascading-style-sheets โ€บ 38951-change-border-color-every-cell-table.html
Change border color for every cell of a table
Hi all, I want to change the border color of every cells or rows of a table but I am not quite sure what is the best way to do it. Personally, I want
๐ŸŒ
Ironspider
ironspider.ca โ€บ tables โ€บ tablecolor.htm
Background and Border Color
Gecko-based browsers, such as Firefox, ... bottom and right sides. bordercolorlight="color definition*" ~ The bordercolorlight attribute can be used to define the border color on the top and left sides of your table....
๐ŸŒ
ETSU Faculty
faculty.etsu.edu โ€บ tarnoff โ€บ ntes1710 โ€บ tables โ€บ tables.htm
HTML Table Basics
The table below has the bordercolor set to #ff00ff with the table tag <table bordercolor="#ff00ff">. To change the background color, use the attribute bgcolor="color".
Find elsewhere
๐ŸŒ
PureCode AI
blogs.purecode.ai โ€บ home โ€บ guide to css table border: make data easily readable
Guide to CSS Table Border: Make Data Easily Readable - Blogs
September 7, 2025 - Here, every cell in the table will have a 1-pixel solid navy border. The border property in CSS is a shorthand that combines border-width, border-style, and border-color.
๐ŸŒ
Screenstepslive
utah.screenstepslive.com โ€บ a โ€บ 1864861-table-borders-and-shading
Table Borders and Shading | Advanced HTML Elements | University of Utah
August 23, 2024 - Select an individual cell to use the general table properties menu to shade an individual cell or, in code, add a style to the td tag to specify the background color for a specific cell. <table style="border-collapse: collapse; width: auto; margin-left: auto; margin-right: auto;" border="1" ...
๐ŸŒ
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 days ago - The border-color property lets you move beyond standard black borders. Color can be used to: ... For instance, a pricing table might use bold colors for headers, while a data table could use subtle shades to separate sections without distracting ...
๐ŸŒ
HTML Tables
htmltables.io โ€บ blog โ€บ html-table-borders
HTML Table Borders โ€” A Complete Guide
April 17, 2024 - In HTML, you can set the border color using a variety of methods, including hexadecimal color codes, named colors, and even RGB or HSL values. Hexadecimal color codes, such as #FF0000 for red or #00FFFF for cyan, offer precise control over the ...
๐ŸŒ
EITCA
eitca.org โ€บ home โ€บ how can you add borders to a table using css?
How can you add borders to a table using CSS? - EITCA Academy
August 7, 2023 - For instance, to set a 2 pixel wide border for the table cells, you can use the following CSS rule: ... 5. Customizing Border Colors: To change the color of the table and cell borders, you can use the "border-color" property. This property accepts color values in various formats, including ...
๐ŸŒ
Geekster
geekster.in โ€บ home โ€บ html table border
HTML Table Border
June 25, 2024 - This adjustment collapses the borders into a single line, eliminating the unwanted double border appearance. Create a visually distinct table by setting background colors for cells while making the border seemingly invisible:
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ CSS โ€บ Reference โ€บ Properties โ€บ border-color
border-color - CSS | MDN
2 weeks ago - #example-element { background-color: #eeeeee; color: black; border: 0.75em solid; padding: 0.75em; width: 80%; height: 100px; } This property is a shorthand for the following CSS properties:
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ css โ€บ how-to-apply-border-inside-a-table
How to apply border inside a table - CSS
July 12, 2025 - Applying a border inside a table involves setting border properties to table elements. Use CSS to specify border width, style, and color.
๐ŸŒ
Tailwind CSS
tailwindcss.com โ€บ docs โ€บ border-collapse
border-collapse - Tables - Tailwind CSS
Use the border-separate utility to force each cell to display its own separate borders: <table class="border-separate border border-gray-400 ..."> <thead> <tr> <th class="border border-gray-300 ...">State</th> <th class="border border-gray-300 ...