Table page break in PDF output

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
Robbee
Jr. Propeller Head
Posts: 4
Joined: Thu Jun 16, 2011 7:36 am

Table page break in PDF output

Post by Robbee »

I have a question about table page break.

Standard for PDF output is that if the table can fit on one page, a page break is created before the table. This has the disadvantage that if the table length is 3/4 of a page but there is only 1/2 page left on the current page, the bottom half of this page will be blank and the table starts on next page.

Is it possible to change this so the table always directly follows the previous object, and break between two rows whenever a page break is needed? (Like it is done in MS Word.)
Andrew
Propellus Maximus
Posts: 1237
Joined: Fri Feb 10, 2006 5:37 am

Re: Table page break in PDF output

Post by Andrew »

If you set the page-break-inside property to "avoid" in your tr element, that should do the trick. Note that this means Flare will avoid creating page breaks inside *any* table row. If you need to be more specific, you'll have to create a style class for it.
Flare v6.1 | Capture 4.0.0
3lliot
Sr. Propeller Head
Posts: 105
Joined: Wed Mar 23, 2011 8:45 pm

Re: Table page break in PDF output

Post by 3lliot »

Andrew, I think you misunderstood the problem. I'm getting the same thing - I have an orphaned heading because my table is longer than 1 page, so the table is being pushed onto the next page, leaving a blank page under the heading.

I would rather the table started directly after the heading, and broke at the end of the page, but the Flare defaults are preventing it.

I've tried myriad combinations of page-break settings. I also tried creating a new class with 'page-break-after: avoid' for my heading, hoping the table would then stick to it, but none of it has worked.

Has anyone found a solution to this? My pdf output looks crap because of this, & the only workaround I can think of is to break the table up into chunks that will all fit inside 1 page. This obviously will look crap in the web output. I may have to create duplicate topics, one for print & one for web.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Table page break in PDF output

Post by LTinker68 »

You might need to create a special class for the heading and table and set the margin and padding on the heading and table different than the norm. Although to you visually it may look like there's enough space on the page to fit everything, Flare, due to CSS, will take into account the box model of the tag and all of that has default spacing. So you might need to explicitly set the margin, padding, and border values for the heading to 0 with maybe just a little bottom margin on the heading tag to separate it from the table.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
rogerbell
Propeller Head
Posts: 20
Joined: Mon Jan 18, 2010 10:34 am
Location: Alpharetta, GA
Contact:

Re: Table page break in PDF output

Post by rogerbell »

3lliot wrote:Has anyone found a solution to this? My pdf output looks crap because of this, & the only workaround I can think of is to break the table up into chunks that will all fit inside 1 page. This obviously will look crap in the web output. I may have to create duplicate topics, one for print & one for web.
The way we handled this problem was in our CSS, we created a Print medium table row (tr) style using the Print Support property of page-break-inside set to a value of "avoid." When applied to rows in a table, this prevents a row from breaking across pages in our PDF output but it does not affect the flow of tables in online Help.

I have found other instances where I still had the headings on one page and table on another. However, I found this may be the result of a bug in the way Flare handles conditions in tables. For example, if I had a row conditioned not to appear in the PDF output, I would get odd results. If I deleted the conditioned row(s), then my page breaks appeared as expected.

Hope that helps you.
Roger
Roger Bell
Technical Information Developer
Bottomline Technologies, Inc.
Alpharetta, GA 30005 USA
+1.770.576.3537 (office)
3lliot
Sr. Propeller Head
Posts: 105
Joined: Wed Mar 23, 2011 8:45 pm

Re: Table page break in PDF output

Post by 3lliot »

Lisa, thanks for the tip but the table is about 2.5 pages long, trying to fit it on 1 page isn't what I want to do. Flare is breaking the table anyway, because it has to, but it insists on pushing it to the next page first. I think it's just missing some smarts when it comes to its page breaking priorities.

If it looked at the table first, & realised that it's too big to fit on 1 page, and it was going to have to break it anyway, it wouldn't bother pushing it to the next page in an attempt to avoid breaking it.

Even with page-break-after set to 'avoid' on my heading and page-break-after set to 'auto' on my <tr>, it still pushes the table off the page.

Roger, your first solution looks like a way to avoid tables breaking inside a row - I'm not sure how that would prevent the table from being pushed off the page? maybe I've misunderstood what you're doing there.
ajturnersurrey
Sr. Propeller Head
Posts: 346
Joined: Fri Nov 05, 2010 3:30 am

Re: Table page break in PDF output

Post by ajturnersurrey »

A vote of sympathy, rather than a solution to your problem

I know what you mean - here is an example of mine
multipage_table_starts_top_next_page.jpg
There follows an 8 or 9 page table, so it would have been nice for it to make use of what was left of page E-1 before going to E-2.
It was annoying me - but in my current documentation only affects this table, so I have just "put up with it" for now, but it would be good to solve this issue!
You do not have the required permissions to view the files attached to this post.
rogerbell
Propeller Head
Posts: 20
Joined: Mon Jan 18, 2010 10:34 am
Location: Alpharetta, GA
Contact:

Re: Table page break in PDF output

Post by rogerbell »

3lliot wrote:Roger, your first solution looks like a way to avoid tables breaking inside a row - I'm not sure how that would prevent the table from being pushed off the page? maybe I've misunderstood what you're doing there.
Yes, my first solution does deal with rows breaking across pages, but if you have some tables with huge rows, it may help.

Does any of the text you have before the table use a paragraph tag? I have found for example in numbered lists when one list item was also a paragraph, it would ignore any page breaking attributes I might also give it. When I unbound it from the paragraph tag and only used the list item tag, it behaved correctly on page breaks. So perhaps this problem may apply to some of you text and headings immediately before your table. Try tagging that text and heading differently to see if it breaks correctly. You may have to resort to inline styles. If that doesn't work, I would say report it as a Flare bug. Good luck.
Roger Bell
Technical Information Developer
Bottomline Technologies, Inc.
Alpharetta, GA 30005 USA
+1.770.576.3537 (office)
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Table page break in PDF output

Post by LTinker68 »

rogerbell wrote:I have found for example in numbered lists when one list item was also a paragraph, it would ignore any page breaking attributes I might also give it.
Where did you give the page-break attribute? The basic rule of thumb with CSS is that the style declaration closest to the content wins. In this case, if your <li> tag had a page-break attribute, that attribute would be overridden by any conflicting page-break attribute specified in the base paragraph tag, because the paragraph is closer to the content than your <li> tag. Likewise, setting a page-break attribute on a <td> tag would be overridden by a page-break attribute set on the ol/ul or li tags or one set on the <p> tag (or one set on a span tag surrounding the text). In this situation, you'd need to create a complex selector that changed the page-break attribute for the <p> tag when it's inside an <li> tag.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
rogerbell
Propeller Head
Posts: 20
Joined: Mon Jan 18, 2010 10:34 am
Location: Alpharetta, GA
Contact:

Re: Table page break in PDF output

Post by rogerbell »

LTinker68 wrote: Where did you give the page-break attribute?
I used the XML editor in Print Layout mode. With my cursor in the text of a paragraph in a list, I set the paragraph break in Format>Paragraph. However, your idea of a CSS change suits me better. Thanks for the tip.
Roger Bell
Technical Information Developer
Bottomline Technologies, Inc.
Alpharetta, GA 30005 USA
+1.770.576.3537 (office)
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Table page break in PDF output

Post by LTinker68 »

Your solution should have worked because that would have created a span tag around the text (or added a style attribute to the <p> tag) and therefore would have been closest to the content and won. Of course, if you have other columns in the same row, then it also has to take into account what's happening in those rows. I've never researched to see how style attributes of this type are handled if there's a conflict elsewhere in the same row.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Post Reply