FIXED: Wrapped SMALL Words in PDF Tables

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
RecPerch
Propeller Head
Posts: 43
Joined: Tue Jan 10, 2017 9:10 am
Location: Denver, CO

FIXED: Wrapped SMALL Words in PDF Tables

Post by RecPerch »

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?
WrappedWords.png
Thanks.

Gary
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.
AlexFox
Sr. Propeller Head
Posts: 149
Joined: Thu Oct 19, 2017 1:56 am

Re: Wrapped SMALL Words in PDF Tables

Post by AlexFox »

You might try setting word-break: keep-all on your table or td?
RecPerch
Propeller Head
Posts: 43
Joined: Tue Jan 10, 2017 9:10 am
Location: Denver, CO

Re: Wrapped SMALL Words in PDF Tables

Post by RecPerch »

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.

Code: Select all

@media Print
{
	table
	{
		width: 100% !important;
		word-break: keep-all !important;
	}
}
And speaking of random, it doesn't matter if the content of the table is identical.
WrappedWords02.png
WrappedWords03.png
You do not have the required permissions to view the files attached to this post.
AlexFox
Sr. Propeller Head
Posts: 149
Joined: Thu Oct 19, 2017 1:56 am

Re: Wrapped SMALL Words in PDF Tables

Post by AlexFox »

Try the following:

On your table selector:

Code: Select all

table-layout:fixed;
and on your th selector:

Code: Select all

white-space: nowrap;
(courtesy of stack exchange)
RecPerch
Propeller Head
Posts: 43
Joined: Tue Jan 10, 2017 9:10 am
Location: Denver, CO

Re: Wrapped SMALL Words in PDF Tables

Post by RecPerch »

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.
WrappedWords04.png
You do not have the required permissions to view the files attached to this post.
AlexFox
Sr. Propeller Head
Posts: 149
Joined: Thu Oct 19, 2017 1:56 am

Re: Wrapped SMALL Words in PDF Tables

Post by AlexFox »

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...
RecPerch
Propeller Head
Posts: 43
Joined: Tue Jan 10, 2017 9:10 am
Location: Denver, CO

Re: Wrapped SMALL Words in PDF Tables

Post by RecPerch »

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!!
AlexFox
Sr. Propeller Head
Posts: 149
Joined: Thu Oct 19, 2017 1:56 am

Re: FIXED: Wrapped SMALL Words in PDF Tables

Post by AlexFox »

No problem, glad you got it resolved!
Post Reply