I am using Firefox 3.5.7 and I have the same CSS used in multiple HTML tables, but there are some examples where parts of the borders are not shown.
What makes no sense to me is that the same CSS on the same page for another HTML table works fine. Also, the same page in Internet Explorer looks fine from a border point of view.
Here is an image with an example, as you can see in this case the bottom of the first table is missing a border.
Does anyone have a clue why this would happen here?
Building on the good answer of @GregL (I seem unable to "comment" directly on it): Instead of using JQuery to generate a "last" class, I simply used the built-in pseudo-element selector
:first-child
. I built rules selectingtr:first-child
andtd:first-child
that defineborder-top
andborder-left
(instead ofborder-right
andborder-bottom
as in GregL's answer). The generic rules defineborder-right
andborder-bottom
instead ofborder-left
andborder-top
.:first-child
is said to be supported in Chrome v. 4.0, Firefox v. 3.0, IE 7.0, Safari v. 3.1, and Opera v. 9.6 (). Tested on Firefox v. 40.0.3, where I saw this problem in the first place.Maybe you've zoomed in/out a bit. This can happen either accidently or knowingly when you do Ctrl+Scrollwheel. Maybe it isn't completely resetted to zoom level zero. This mis-rendering behaviour is then recognizeable at some websites, also here at SO.
To fix this, just hit Ctrl+0 or do View > Zoom > Reset to reset the zoom level to default.
This is Firefox/Gecko bug 410959. This affects tables with
border-collapse:collapse
. It's from 2008 and there's no real progress on it, so you'll probably need to find a workaround. One way is usingborder-collapse:separate
and fiddling with borders on a per-cell basis.I had the same problem with missing table border. My solution is:
And border for table rows:
I am using Bootstrap either in my layout and the table has also bootstrap css classes like "table table-striped table-bordered"
This solution works for me, when I tried solution with
it didn't work properly for me.
I found a similar problem when zoomed out in Firefox on an application I am working on.
The main cause was having the CSS
border-collapse
property set tocollapse
.Changing it to
separate
instead fixed the problem. However, that meant I did have to rethink the way borders are applied to various parts of the table, because otherwise your borders will appear to double in thickness. I ended up having to use jQuery to give a special "last" class to the lasttd
orth
in eachtr
, and to the lasttr
in the table. My query was something like:My CSS rules were similar that:
I did end up using browser targeting so that I only applied these rules to Firefox users, but it may work for all browsers, I haven't tested.
worked for me realisation of answer @Donald Payne
*( .table - bootstrap class )
This was caused by the table (with a missing bottom-border) to be inside a div...The border apparently didn't get calculated in the table height, so the border was there but wasn't shown.
Giving the surrounding div a margin-bottom from 1px solved the problem.