-
Notifications
You must be signed in to change notification settings - Fork 45
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
Inner borders on table cells missing #404
Comments
Yes, not easy to get right. We take some shortcuts around there to keep the (already tedious) work low: crengine/crengine/src/lvrend.cpp Lines 935 to 947 in 8254cef
For your expected output, we'd have to report some borders from some cells to some other cells - which feels quite more complicated. |
Interesting. For my own future reference, the border-collapsing model is described here: https://www.w3.org/TR/CSS2/tables.html#borders However, what's the thinking behind this bit?
Since I suppose "most" tables that set borders on rows/cols/cells individually default to no borders and turn them on selectively, it's seems likely that the current "top and left only" method is falsely turning borders off than falsely turning then on (or overriding with the wrong style)? For example, a In the EPUB above, just commenting lines 948 to 951 crengine/crengine/src/lvrend.cpp Lines 948 to 951 in 8254cef
produces this: |
It's the way crengine does its drawing: it doesn't do: draw borders, and then, between the borders, the cell content. But, for drawing a 1px collapsed/shared border, if each cell would draw its own, we'll have 2px borders. So, the solution for collapsing was to kill 2 borders (nearly arbitrary, but see my comment) on each cell, so each cells draws fully 2 borders, and get the other 2 from adjacent cells. Doing differently would need another (tedious) algorithm to decide what to cancel and what not, and possibly shift a bit cells' x/y/h/w so they align correctly whether some provide some borders and others not... |
Oh, I seeeeeee. Makes much more sense now. |
To not lose it, some related discussion on gitter around https://gitter.im/koreader/koreader?at=5ff4d73dacd1e516f8d637f9 |
The following HTML:
In Koreader, the result is something like this:
The expected output is more like this (Firefox):
Table border.epub.zip
The text was updated successfully, but these errors were encountered: