FIXED. Need to put "cell" padding in the th, td tags NOT the p.tableBody, p.tableHeader tags.
Hi.
I've scoured the forum and help and haven't found anything quite like my problem. When I create a PDF, some small words in the table get wrapped even if there's plenty of space in the table width. This happens in both the header and body. In the screenshot below, see the right-side of the header, the words "Required?" and "Default".
Flare 2017 r3
Column widths are set to AutoFit to Contents.
I've tried table width auto and table width 100%.
The tables look fine in Flare and in the HTML5 output.
I have dozens of tables and would like a global fix rather than going to each problem table and setting specific column widths.
Thoughts?
Thanks.
Gary
FIXED: Wrapped SMALL Words in PDF Tables
FIXED: Wrapped SMALL Words in PDF Tables
You do not have the required permissions to view the files attached to this post.
Last edited by RecPerch on Wed Feb 14, 2018 9:47 am, edited 1 time in total.
Re: Wrapped SMALL Words in PDF Tables
You might try setting word-break: keep-all on your table or td?
Re: Wrapped SMALL Words in PDF Tables
Thanks for the tip, Alex. Unfortunately it didn't work at the table level (haven't tried it at the cell level).
I also changed orientation to landscape because I have a bunch of wide tables and realized (regardless of this bug (and I'm assuming it's a bug as it's only the last character or two in a line, never more than that) that I need that extra width. But landscape doesn't "fix" the bug.
Would rather not add column widths to the offending tables as the content needs to be both online (responsive) and PDF.
And speaking of random, it doesn't matter if the content of the table is identical.
I also changed orientation to landscape because I have a bunch of wide tables and realized (regardless of this bug (and I'm assuming it's a bug as it's only the last character or two in a line, never more than that) that I need that extra width. But landscape doesn't "fix" the bug.
Would rather not add column widths to the offending tables as the content needs to be both online (responsive) and PDF.
Code: Select all
@media Print
{
table
{
width: 100% !important;
word-break: keep-all !important;
}
}
You do not have the required permissions to view the files attached to this post.
Re: Wrapped SMALL Words in PDF Tables
Try the following:
On your table selector: and on your th selector: (courtesy of stack exchange)
On your table selector:
Code: Select all
table-layout:fixed;
Code: Select all
white-space: nowrap;
Re: Wrapped SMALL Words in PDF Tables
Ha, the nowrap gives me this (I added it to both th and td as the error happens in both types of cells). Also tried word-break: keep-all at the th, td level without success.
You do not have the required permissions to view the files attached to this post.
Re: Wrapped SMALL Words in PDF Tables
I wouldn't suggest setting it on td, instead try something like pre-wrap.
I've not used these much before, so a little guesswork is going on here...
I've not used these much before, so a little guesswork is going on here...
Re: Wrapped SMALL Words in PDF Tables
Huzzah.
Started playing with padding. When I built my css I put the "cell" padding inside the table's paragraph tags (p.tableBody, p.tableHeader). So I removed it from the paragraph tags and put it in the th, td tags.
And it worked!! No more weird word wrapping. I assume this was a "rookie" mistake on my part and that I should have never put padding at the text level for a table.
Alex, thanks for your time and effort ... I apologize for my ignorance!!
Started playing with padding. When I built my css I put the "cell" padding inside the table's paragraph tags (p.tableBody, p.tableHeader). So I removed it from the paragraph tags and put it in the th, td tags.
And it worked!! No more weird word wrapping. I assume this was a "rookie" mistake on my part and that I should have never put padding at the text level for a table.
Alex, thanks for your time and effort ... I apologize for my ignorance!!
Re: FIXED: Wrapped SMALL Words in PDF Tables
No problem, glad you got it resolved!