How to keep all entire rows together on the same page when assembling tables.
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 495
- Joined: Wed Oct 16, 2019 3:47 pm
Re: How to keep all entire rows together on the same page when assembling tables.
Post by julien_lacour »
Hello,
Yes, the keep-together.within-page FO attribute will help you avoiding page-breaks inside a row.
If you are using DITA documents and the DITA Map PDF - based on XSL-FO transformation on a recent version of Oxygen (which uses DITA-OT 3.x), the following style-sheet is included by default:
Which means that all the <fo:table-row> elements present the attribute, like this:
Could you indicate which version of Oxygen you are currently using?
Could you also precise which input you want to transform into PDF?
Regards,
Julien
Yes, the keep-together.within-page FO attribute will help you avoiding page-breaks inside a row.
If you are using DITA documents and the DITA Map PDF - based on XSL-FO transformation on a recent version of Oxygen (which uses DITA-OT 3.x), the following style-sheet is included by default:
Code: Select all
<xsl:attribute-set name="tbody.row">
<!--Table body row-->
<xsl:attribute name="keep-together.within-page">always</xsl:attribute>
</xsl:attribute-set>
Code: Select all
<fo:table-row keep-together.within-page="always">
...
</fo:table-row>
Could you also precise which input you want to transform into PDF?
Regards,
Julien
Re: How to keep all entire rows together on the same page when assembling tables.
Hi, thanks for the reply.
Could you indicate which version of Oxygen you are currently using?
The current version I'm using is Oxygen 23.0
Could you also precise which input you want to transform into PDF?
While assembling tables in a dita document file(topic), I want the table rows with content that could bleed into another page to stay on one page while transforming to PDF.
Could you indicate which version of Oxygen you are currently using?
The current version I'm using is Oxygen 23.0
Could you also precise which input you want to transform into PDF?
While assembling tables in a dita document file(topic), I want the table rows with content that could bleed into another page to stay on one page while transforming to PDF.
Re: How to keep all entire rows together on the same page when assembling tables.
I wanted to keep the contents of the row together on the same page while assembling tables.. I've tried using keep-together.within-page="always", keep-together.within-column="always" and keep-with-next.within.page="always" separately in <fo:table-row> but it is not showing the desired result. What should be done in-order to get the content of row together on the same page?
Last edited by shiney_98 on Thu Sep 16, 2021 9:38 am, edited 2 times in total.
-
- Posts: 495
- Joined: Wed Oct 16, 2019 3:47 pm
Re: How to keep all entire rows together on the same page when assembling tables.
Post by julien_lacour »
Hello,
As I mentioned before, in the DITA Map PDF - based on XSL-FO transformation, this attribute is automatically set by the following attribute-set (in org.dita.pdf2/cfg/fo/attrs/tables-attr.xsl):
If you run the default transformation you will see that the table row is moved into another page, like in this example:
Rows from table body are generated by the following template:
You can use this template as a starting point for your customization.
You can also run the transformation with the clean.temp=no parameter, you can then check the topic.fo file.
It must contain <fo:table-row keep-together.within-page="always"> for each table row.
Regards,
Julien
As I mentioned before, in the DITA Map PDF - based on XSL-FO transformation, this attribute is automatically set by the following attribute-set (in org.dita.pdf2/cfg/fo/attrs/tables-attr.xsl):
Code: Select all
<xsl:attribute-set name="tbody.row">
<!--Table body row-->
<xsl:attribute name="keep-together.within-page">always</xsl:attribute>
</xsl:attribute-set>
- table.png (43.62 KiB) Viewed 4587 times
Code: Select all
<xsl:template match="*[contains(@class, ' topic/tbody ')]/*[contains(@class, ' topic/row ')]">
<fo:table-row xsl:use-attribute-sets="tbody.row">
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates/>
</fo:table-row>
</xsl:template>
You can also run the transformation with the clean.temp=no parameter, you can then check the topic.fo file.
It must contain <fo:table-row keep-together.within-page="always"> for each table row.
Regards,
Julien
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service