danfickle / danfickle/openhtmltopdf

Issue with table border width and pagination

Open
#635 1 comment 0 reactions 1 assignee Claimed by @danfickle View on GitHub
Dominant language
Java
Stars
2.2k
Forks
423
PR merge metrics
No merged PRs in 30d

Description

Hi,

first of all, thank you for this awesome library.

I've encountered some problems with tables I just can't seem to fix myself.

1. When I create a table where borders cross there seems to be an issue with the border width. It appears to be thicker for one cell after the junction (see screenshot 1). I tried it with different pdf-readers and browsers, and although it appears to get better the more you zoom out, it really stands out when zoomed in. Maybe I'm doing something wrong with the css? Or it is a bug? The lines don't appear to have different width when I use either vertical or horizontal lines, only when they cross, and just for one cell in each direction.
2. Pagination for larger tables works fine, my headers repeat on each page and everything looks good. However, if I use `page-break-after: avoid;` in the css, and a page break is avoided by this rule, the headers disappear. The borders for them are still there but the text is missing (see screenshot 2). When the `page-break-after: avoid;` rule does NOT apply for one page, everything looks good again.

I created a repository [here](https://github.com/axd3/pdf-table-test) where you can reproduce the beaviour. Just run the PdfTableTest.java and look at foo.pdf. Any help would be appreciated!

Screenshot 1
![Screenshot_20210113_135350_edit](https://user-images.githubusercontent.com/53512923/104464495-47615480-55b3-11eb-97d3-c1549557efc4.png)

Screenshot 2
![Screenshot_20210113_151332](https://user-images.githubusercontent.com/53512923/104464027-c30ed180-55b2-11eb-8f0c-a78aa2ce9b61.png)

Thank you!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.