Skip to content
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

Row break not working and different in 3.1.1 and 3.2.2 #532

Closed
t-book opened this issue Aug 11, 2019 · 3 comments
Closed

Row break not working and different in 3.1.1 and 3.2.2 #532

t-book opened this issue Aug 11, 2019 · 3 comments
Labels

Comments

@t-book
Copy link

t-book commented Aug 11, 2019

Hi,

I'm fighting with the rendering of content-rich tables. One cell has text which should overflow to the next page. Unsure if this has been already reported but it looks like a bug to me.

jsPDF-AutoTable3.1.1
https://codepen.io/t-book/pen/OKBQbG

Will correctly cut the row and put in on the next page. Unfortunately
the bottom border calculation is wrong and text runs out of the table.

Bildschirmfoto 2019-08-11 um 11 28 58

jsPDF-AutoTable-3.2.2
https://codepen.io/t-book/pen/voVdrb
Does not break the row anymore. The Text is just cutoff.

While I could live with the behavior of 3.1.1 I would be curious if it's possible to avoid the text-overflow or if I'm missing something with version 3.2.2? The pens will show the used configuration. II will put the interesting part here:

    doc.autoTable({
        columnStyles: { 0: {halign: 'left', minCellWidth: 50, fontStyle: 'bold', textColor: [0, 0, 0], font: 'csv-b'},
                        1:{halign: 'left',textColor: [0, 0, 0], minCellWidth: 135,font: 'csv-m'}}, 
        margin: {top: 30},
        pageBreak: 'avoid',
        rowPageBreak: 'avoid',
        theme: 'grid', 

EDIT FOR COMPLETNESS:
Fiddle for 3.2.3 which is working nicely: https://codepen.io/t-book/pen/NWKxeMr

Thanks a lot for your help and this great plugin,

Toni

@simonbengtsson
Copy link
Owner

I have seen multiple issues in this area lately so I'm working on rewriting the entire calculation for when to break pages etc. Especially regarding rowspans. Thanks for reporting and I'll take this example into consideration for the next release to make sure it is working 👍

@t-book
Copy link
Author

t-book commented Aug 12, 2019

Wonderful, thanks a lot @simonbengtsson

@simonbengtsson
Copy link
Owner

Fix is available in v3.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants