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 › css › css_table.asp
CSS Styling Tables
The CSS border property is used to specify the width, style, and color of table borders. ... Notice that the tables in the examples above have double borders.
🌐
W3Schools
w3schools.com › css › css_border_color.asp
CSS Border Color
CSS Templates CSS Examples CSS Editor CSS Snippets CSS Quiz CSS Exercises CSS Website CSS Syllabus CSS Study Plan CSS Interview Prep CSS Bootcamp CSS Certificate · CSS Reference CSS Selectors CSS Combinators CSS Pseudo-classes CSS Pseudo-elements CSS At-rules CSS Functions CSS Reference Aural CSS Web Safe Fonts CSS Animatable CSS Units CSS PX-EM Converter CSS Colors CSS Color Values CSS Default Values CSS Browser Support ... The border-color property is used to set the color of the four borders.
🌐
W3Schools
w3schools.com › html › html_table_borders.asp
HTML Table Borders
To add a border, use the CSS border property on table, th, and td elements: table, th, td { border: 1px solid black; } Try it Yourself » · To avoid having double borders like in the example above, set ...
🌐
Ironspider
ironspider.ca › tables › tablecolor.htm
Background and Border Color
Internet Explorer will use your selected color to display one solid colored frame around your table. Gecko-based browsers, such as Firefox, will create a 3D lighting effect using a light version of your color on the top and left sides and a dark version of your color on the 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.
🌐
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 ...
🌐
HTML AM
html.am › html-codes › tables › table-border.cfm
Table Border
For example, for a thin border, use the number "1". For a thicker border, use a greater number. ... As you can see, this is a quick and easy way to get a table border, but you don't actually have any control over the way the border looks. The way it looks will depend on the user's browser and you won't be able to change it. Unless... If you want to change the way your table border looks, you can use CSS. CSS allows you to change the color...
🌐
HTML.com
html.com › attributes › table-bordercolor
What Does HTML Bordercolor Attribute Does To Your Tables? [Clue: Color!] »
December 20, 2019 - <TABLE BORDER=10 BORDERCOLOR=RED> <TR> <TD>carrots</TD> <TD>garlic</TD> </TR> <TR> <TD>celery</TD> <TD>onions</TD> </TR> </TABLE> ... Netscape and MSIE have very different ways of rendering BORDERCOLOR.
Find elsewhere
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › border-color
border-color - CSS | MDN
#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:
🌐
Scientech Easy
scientecheasy.com › home › blog › html table borders
HTML Table Borders - Scientech Easy
February 22, 2025 - ... <!DOCTYPE html> <html> <head> <style> table { border-collapse: collapse; border-width: 1px; border-style: solid; border-color: black; /* Setting the border color for the table*/ } /* Sets the background color for all table header cells */ ...
🌐
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 - This property allows you to set ... CSS rule: ... 5. Customizing Border Colors: To change the color of the table and cell borders, you can use the "border-color" property....
🌐
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
🌐
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 - This media query changes the border color to light gray on screens smaller than 600 pixels in width, which might look better on mobile devices. For more creative designs, CSS allows for various border styles like groove, ridge, inset, and outset.
🌐
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". The table below has its background color set to #00ff00 with a table tag of <table bgcolor="#00ff00">. To set a tiled background ...
🌐
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
4 days ago - While the basic border attribute works for simple tables, CSS offers far more control over how borders appear, including style, thickness, color, spacing, and advanced effects like rounded corners and shadows. This guide explains how to create and style table borders step by step. You’ll see practical examples for basic HTML tables, learn how to apply CSS for precise customization, and discover solutions for common display issues.
🌐
HTML.com
html.com › attributes › tr-bordercolor
Attributes for BORDERCOLOR = color expressionBORDERCOLORDARK = color expressionBORDERCOLORLIGHT = color expression
July 3, 2017 - <style> .example-table td:nth-child(n+2) { border-left: 2px solid green; } </style> <table class="example-table"> <tr><td>First column</td><td>Second column</td><td>Third column</td></tr> <tr><td>First column</td><td>Second column</td><td>Third ...
🌐
W3Docs
w3docs.com › html
How to Add Border to HTML Table
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> table, td, th { padding: 10px; border: 2px solid #1c87c9; border-radius: 5px; background-color: #e5e5e5; text-align: center; } </style> </head> <body> <table> <tr> ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › border-style
border-style - CSS | MDN
... <section id="default-example"> <div class="transition-all" id="example-element"> This is a box with a border around it. </div> </section> #example-element { background-color: #eeeeee; color: black; border: 0.75em solid; padding: 0.75em; width: 80%; height: 100px; } body { background-color: ...
🌐
TAG Index
tagindex.net › html › table › table_bordercolor.html
HTML/Table Tags/border color - TAG index
HTML Tag Reference. Specifies the border color of the table. Codes and Examples.