Table breaks and repeating headers

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
erinhill
Propeller Head
Posts: 23
Joined: Wed Aug 05, 2020 1:35 pm

Table breaks and repeating headers

Post by erinhill »

Hi! Am I able to do something that doesn't break a table's rows across two pages? Am I also able to repeat table headers if the table goes to another page?

Thanks!
robdocsmith
Sr. Propeller Head
Posts: 247
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: Table breaks and repeating headers

Post by robdocsmith »

As far as keeping a table all on the same page, the only way I know of doing this is to use a DIV around the table. I have a default style defined that I can use wherever I don't want stuff to break across columns or pages:

.keeptogether {
page-break-inside: avoid;
column-break-inside: avoid;
}

Then, just wrapping your content (or table) in a <div class="keeptogether"></div> will hold it to the same text frame - provided that it physically can fit in that text frame. If it's bigger than the frame you can't avoid the break.

To get headers and footers to repeat across tables, they need to be defined as headers and footers in the table. Right click the table and choose Table Properties. Make sure you've added a Header row in the Table Size section. You'll need to style the header row separately to the normal rows. In the xml your table will then look like:

Code: Select all

<table>
    <thead>
        <tr><th>Head 1</th><th>Head 2</th></tr>
    </thead>
    <tbody>
        <tr><td>Cell 1</td><td>Cell 2</td></tr>
    </tbody>
</table>
Cheers,

Rob
Post Reply