Reputation: 39456
I'm working on the following website which uses a dotted border (applied to table cells) to contain most of the website content.
It works fine overall, but there's a small issue in Chrome where the two collapsed dotted borders sometimes make up one solid border (Fig 1); an example of this can be found on the Signatories page at the bottom.
A similar effect applies to Internet Explorer also, however it's more consistent and rather than the line being solid, it seems like every nth dot is doubled up (Fig 2).
Is this a known issue that has an easy enough to implement solution?
Fig1:
Fig2:
Please don't spam me with "you shouldn't use tables for layouts" - I'm fully aware of that.
There are a few prime reasons that I'm doing this:
Upvotes: 4
Views: 5394
Reputation: 56
border-collapse is your culprit.
I ran into this issue with a dotted bottom border is a table (that was actually a table, not a layout).
First, set "border-collapse: separate;"
Anything with a border, set the border;
Then set the border width to 0px for anything that did not have a border.
That should get you there for Chrome.
Upvotes: 4
Reputation: 4659
Jon P makes a good point you really shouldn't use tables for layout. That being said I understand that sometimes it's necessary.
From the looks of it the problem in chrome lies with the colspan of the td's which are even more evil for tables layout.
Recommendation:
Don't use colspan on the bottom just style a specific border-left: none; For the first person create a new table and set the width on that table to the same as the original table, set the width of the last column on both the new table and the original and then make sure that you set border-top: none for the first row of the original table.
Or better yet convert to a div layout. If you interested in converting let me know I am pretty sure I could work it up in about 20-30 minutes.
As for IE everything looks good in IE9 in default mode, in compatability mode (IE8) it looked like there was a problem with the first colspan on the bottom.
/--- EDIT ---/
If you are allowing the client to modify the code(perfectly acceptable) then you really only have a couple of options since this is a render problem with the browsers.
I don't think that any of these solutions are truly ideal but when you let the customer modify the site you limit yourself when problems arise.
Upvotes: 1
Reputation: 21507
Set up border-top
and border-left
to be dotted 1px, and right and bottom to be none. Then add right and bottom borders to container.
p.s.: don't use tables for layout, unless you are laying out a true table! it has very bad effects on rendering speed, its NOT cross-browser (contrary to what most people think and say) and its hard to maintain.
Upvotes: 0