Jump to content

<fo:table-header> orphaned at the end of first page


meirbarak

Recommended Posts

Hi Everyone,

I am facing an issue wherein I have a dynamic table that can grow in size spanning over multiple pages. This table starts at the bottom of the first page and continues on the next page, with table header appearing on both the pages. This is exactly what I want but the header on the first page is orphaned without any rows from the body of the table.

 

My ideal solution is, first page should show header only if it can show atleast one row from the body.

 

I have tried the following things:

 

1) fox:orphan-content-limit and fox:widow-content-limit on the table level

2) keep-with-next="always" on the row of the header but this also doesn't work as there is no connection between row of the header and the row of the body

3) keep-together="always" at the table level but it tries to print the entire table on the second page with blank pages above and below.

 

Here is how my xsl looks like:

 

<fo:table >
<fo:table-column column-width="50%" />
<fo:table-column column-width="50%" />
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block >ABC</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>XYZ</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<xsl:for-each select="Message/list1/list1Element">
<fo:table-row keep-together="always">
<fo:table-cell >
<fo:table>
<fo:table-column />
<fo:table-column column-width="90%"/>
<fo:table-column />
<fo:table-body>
<fo:table-row >
<fo:table-cell>
<fo:block > </fo:block>
</fo:table-cell>
<fo:table-cell keep-together.within-column="always">
<xsl:for-each select="list2/list2Element">
<fo:block space-after="always"/>
<fo:block page-break-inside="always">
<fo:block page-break-inside="always" ><fo:inline keep-together.within-column="always"> someValue</fo:inline></fo:block>
</fo:block>
</xsl:for-each>
<fo:block />
</fo:table-cell>
<fo:table-cell>
<fo:block ></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-cell>
<fo:table-cell >
<fo:table>
<fo:table-column />
<fo:table-column column-width="90%"/>
<fo:table-column />
<fo:table-body>
<fo:table-row >
<fo:table-cell>
<fo:block > </fo:block>
</fo:table-cell>
<fo:table-cell keep-together.within-column="always">
<xsl:for-each select="list2/list2Element">
<fo:block space-after="always"/>
<fo:block page-break-inside="always">
<fo:block page-break-inside="always" ><fo:inline keep-together.within-column="always"> someValue</fo:inline></fo:block>
</fo:block>
</xsl:for-each>
<fo:block />
</fo:table-cell>
<fo:table-cell>
<fo:block ></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
I would appreciate any help on this. thanks.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...