Controling table width with CSS in PDF output?

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
kydeck
Jr. Propeller Head
Posts: 8
Joined: Thu May 03, 2018 12:38 pm

Controling table width with CSS in PDF output?

Post by kydeck »

Hello everyone! What I'm trying to do here is set up a system where my tables will always be as wide as their containers, so 100% wide in css terms. What I'm noticing is that even though I've set my table's width to be 100% in several spots (including in-line out of desperation), the table sizing seems to be inheriting the width of it's parent regardless of what I set it to (but works as expected in web output). Is there any way to set fluid-width on a table that it will respect in PDF output or am I forever locked into setting absolute widths for print output?
table-width.PNG
Here's a visual representation of what I'm struggling with, the red border is the right boundary of my container (in this case the container has a set width of 75% of the page), you can see the paragraph tags with a blue border fill the whole container. My table on the other hand, despite having width:100%;, is not filling up the whole container but is actually only filling up about 75% of the container. (This an interesting note since that is what the parent's width is set to, is this a bug where the table is inheriting this width when it should not be?)
You do not have the required permissions to view the files attached to this post.
Last edited by kydeck on Tue May 22, 2018 6:35 am, edited 1 time in total.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Controling table width with CSS in PDF output?

Post by ChoccieMuffin »

Sorry, I can't see your link. Can you upload your screenshot as an attachment instead?
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
kydeck
Jr. Propeller Head
Posts: 8
Joined: Thu May 03, 2018 12:38 pm

Re: Controling table width with CSS in PDF output?

Post by kydeck »

ChoccieMuffin wrote:Sorry, I can't see your link. Can you upload your screenshot as an attachment instead?
Definitely! I hadn't seen that feature before but that's much better.
Psider
Propellus Maximus
Posts: 816
Joined: Wed Jul 06, 2011 1:32 am

Re: Controling table width with CSS in PDF output?

Post by Psider »

Could you do a super long title or footnote, so that it wraps? You might find that it wraps exactly where the your table is. (I'm assuming the blue and red lines are added in a graphics tool, rather than being part of the styles you've set up.)
AlexFox
Sr. Propeller Head
Posts: 161
Joined: Thu Oct 19, 2017 1:56 am

Re: Controling table width with CSS in PDF output?

Post by AlexFox »

You could try building a HTML5 target using your print medium, to be able to properly inspect what's going on.
kydeck
Jr. Propeller Head
Posts: 8
Joined: Thu May 03, 2018 12:38 pm

Re: Controling table width with CSS in PDF output?

Post by kydeck »

Psider wrote:Could you do a super long title or footnote, so that it wraps? You might find that it wraps exactly where the your table is. (I'm assuming the blue and red lines are added in a graphics tool, rather than being part of the styles you've set up.)
That would be one way to do it I think, make sure the content completely fills the table. Unfortunately I'm just the designer/developer and others will be adding the content in.
kydeck
Jr. Propeller Head
Posts: 8
Joined: Thu May 03, 2018 12:38 pm

Re: Controling table width with CSS in PDF output?

Post by kydeck »

AlexFox wrote:You could try building a HTML5 target using your print medium, to be able to properly inspect what's going on.
I have done that actually and HTML5 output behaves as expected (the table fills 100% of it's parent container with width:100%;). So I believe there's something strange happening in the PDF rendering engine.
Psider
Propellus Maximus
Posts: 816
Joined: Wed Jul 06, 2011 1:32 am

Re: Controling table width with CSS in PDF output?

Post by Psider »

kydeck wrote:That would be one way to do it I think, make sure the content completely fills the table. Unfortunately I'm just the designer/developer and others will be adding the content in.
I meant in your heading and regular paragraph as a test, just to ensure the text fills where you expect it. From the screenshot I can't tell this is the case.
Post Reply