-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
table borders: single border display bug with border-collapse: collapse #752
Comments
I think I've found the culprit! It turns out to be related to anti-aliasing. Specifically, the top and bottom borders for cell 3 are not anti-aliased while all others are. I think this is because all the other borders need to have a bevel (diagonal edge) (which we calculate explicitly) to meet with vertical lines. You can see this in effect with the magnifier on your operating system. Alternatively, if using Acrobat, you can turn off anti-aliasing of lines by unticking "Edit Preferences -> Page Display -> Smooth line art". Please reply if changing this setting fixes your actual document so I know I'm going in the right direction. The bad news is that there is no way to turn off AA for lines at the document level. The good news is that for most cases we should be able to disable anti-aliasing by not beveling our lines. This should work well for borders where meeting borders are the same color and thickness. With borders meeting different colors or thickness, there doesn't seem to be a great solution. I'll start work on this. |
with solid style borders only. This should stop them being anti-aliased and problematic. Unfortunately some tests had to be re-proofed for this change. Additional test kindly provided by @gandboy91
Thank you for your fix and explanation! 👍 Will wait for next release! |
…isable bevels on borders. Doing so avoids ugly anti-aliasing effects, especially on tables. Property is: -fs-border-rendering: no-bevel and inherits so can be set at the table level to apply to all cells. This commit is a better alternative to the work in #755.
When some cell borders are hidden (as 2, 3 and 4 cells in example)
There's buggy behavior of table borders in generated pdf.
It's usually ok with default 100% zoom level.
But if it's zoomed in or zoomed out, some borders looks very unstable (cell 3 in example)
Depending on zoom level it can be thinner or thicker than other borders.
example is created with openhtmltopdf sandbox.
html
markup
css
P.S. even without border collapse, with cellpadding="0" and some tricks
like display only right and bottom cell borders and for all table left and top borders
(to make sure that there's indeed only single border everywhere)
border thickness is displayed buggy when zoom in/zoom out
The text was updated successfully, but these errors were encountered: