Breaking tables between pages and repeating the header

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
Eric Lachance
Sr. Propeller Head
Posts: 127
Joined: Thu May 13, 2010 11:51 am
Location: Montreal, Quebec, Canada
Contact:

Breaking tables between pages and repeating the header

Post by Eric Lachance »

Is there any way to use the stylesheet to specify that, in a printed output, tables that are broken down between two pages should repeat the header (<thead>), as well as the <caption> caption (but adding (continued) in the end?)

I see this in printed manuals all the time, right now I have at least one place where the table is broken down manually in 3 parts, but I'd like for it to do it automatically since adding or removing any text in the manual may change where that table is displayed, thus force me to re-do the break points.

Basically, the table would be this:

Code: Select all

<table>
 <col/><col/>
 <caption>Table X-X</caption>
 <thead>
  <tr><td>Name</td><td>Description</td></tr>
 </thead>
 <tbody>
  <tr><td>Name X</td><td>Description X</td></tr>
  <tr><td>Name X</td><td>Description X</td></tr>
  <tr><td>Name X</td><td>Description X</td></tr>
  <tr><td>Name X</td><td>Description X</td></tr>
 </tbody>
</table>
If the table were to break down, here's what I'd like to happen (say it's broken in 2 parts):

Code: Select all

<table>
 <col/><col/>
 <caption>Table X-X</caption>
 <thead>
  <tr><td>Name</td><td>Description</td></tr>
 </thead>
 <tbody>
  <tr><td>Name X</td><td>Description X</td></tr>
  <tr><td>Name X</td><td>Description X</td></tr>
 </tbody>
</table>
<!-- page break caused by running out of space --->
<table>
 <col/><col/>
 <caption>Table X-X (continued)</caption>
 <thead>
  <tr><td>Name</td><td>Description</td></tr>
 </thead>
 <tbody>
  <tr><td>Name X</td><td>Description X</td></tr>
  <tr><td>Name X</td><td>Description X</td></tr>
 </tbody>
</table>
Is this even possible? I noticed I could set the page-break-before to avoid or always for a specific TR, but that's not automatic (nor does it re-add the header and caption).
Eric Lachance
Technical Trainer
Objectif Lune Inc.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Breaking tables between pages and repeating the header

Post by LTinker68 »

I started adding the following code to my stylesheets years ago, and if I remember why, it was to have the header row of a table repeat across pages. I could be wrong about what it does, though.

Code: Select all

thead
{
	display: table-header-group;
}
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Eric Lachance
Sr. Propeller Head
Posts: 127
Joined: Thu May 13, 2010 11:51 am
Location: Montreal, Quebec, Canada
Contact:

Re: Breaking tables between pages and repeating the header

Post by Eric Lachance »

Well, that works fine for the thead row, but not for the caption.

Good enough, I'll just do something else for the caption!

Thanks :)
Eric Lachance
Technical Trainer
Objectif Lune Inc.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2650
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Breaking tables between pages and repeating the header

Post by ChoccieMuffin »

This might be a completely silly suggestion (feel free to ignore it, or the lovely Lisa will tell me I've eaten too much stupid-cake today) but could you put the caption in another Header row? If you did that I am just guessing that the caption should repeat as well as the table heading.

But of course I could be completely wrong. :)
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Breaking tables between pages and repeating the header

Post by LTinker68 »

It's possible. You'd have to specify two header rows for the table, then merge the cells of the first row and move the caption to that row. If you're using a table stylesheet, you could set a pattern for the header rows and set the first row pattern to have a default background color (i.e., no background color) and set the second header row's pattern to a background color. The downside is that you'd have a border around the caption cell. And you'd probably want to insert a paragraph inside the caption row so you could specify a class, otherwise the caption would appear similar to a header column style, which by default is bold and centered, and you may want it smaller and not bold.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Eric Lachance
Sr. Propeller Head
Posts: 127
Joined: Thu May 13, 2010 11:51 am
Location: Montreal, Quebec, Canada
Contact:

Re: Breaking tables between pages and repeating the header

Post by Eric Lachance »

Thanks for the suggestions!

It's not critical that the caption be there - I think people are smart enough to realize that the table is split in 2 pages at a glance. After all, our clients are - generally - somewhat over the average in technical expertise. Can't rely on that too much, but it's still better than what it was before.

Cheers!
Eric Lachance
Technical Trainer
Objectif Lune Inc.
Post Reply