Hi all,
I am trying to create a table (1 column) with the dynamic width of the content (max. width = width of PDF template width, of course).
Is there a way to do that? Autosize option will do this for web output, as documentation stated. Any chance to get this done for PDF?
Background:
I need to create a paragraph with a line above the text. The line should end with the last character (more or less). Due to paragraph border creates a line over the whole paragraph, my idea was to create a table with 1 column and 2 rows. Row 1 with a line (as background image), row 2 (with white background) contains the text. This works, but I have to resize each table manually for ending the line above the last character.
Thanks.
PDF: Table or table cell with width of content
Moderators: Alexander Halser, Tim Green
-
- Posts: 50
- Joined: Tue Apr 30, 2019 4:29 pm
- Tim Green
- Site Admin
- Posts: 23157
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: PDF: Table or table cell with width of content
Hi Markus,
There's a trick you can use to achieve this: Turn off word wrap for the paragraph you are using to "size" the table. Then the text is an unresizable block, just like a graphic. Then in the table properties select the selected cells tab and set the preferred width to something slightly less than the minimum width expected for the text. Since content has priority in table sizing this will force the table to have exactly the same width as the content.
WARNING: Caution with this method in multi-column tables! That will make Help+Manual set the widths of ALL columns to automatic, which will not produce desirable results in many cases.
There's a trick you can use to achieve this: Turn off word wrap for the paragraph you are using to "size" the table. Then the text is an unresizable block, just like a graphic. Then in the table properties select the selected cells tab and set the preferred width to something slightly less than the minimum width expected for the text. Since content has priority in table sizing this will force the table to have exactly the same width as the content.
WARNING: Caution with this method in multi-column tables! That will make Help+Manual set the widths of ALL columns to automatic, which will not produce desirable results in many cases.
Regards,
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
-
- Posts: 50
- Joined: Tue Apr 30, 2019 4:29 pm
Re: PDF: Table or table cell with width of content
Thanks, Tim. I will try your tip.