Keep a table on the same page
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 68
- Joined: Tue Jun 09, 2015 6:26 pm
- Location: Canada
Keep a table on the same page
Post by BogdanM777 »
Hi guys,
I would have another question for you:
How could I keep a table "whole" on a page, i.e. not to have it split over 2 pages, if its size permits of course?
Thank you
I would have another question for you:
How could I keep a table "whole" on a page, i.e. not to have it split over 2 pages, if its size permits of course?
Thank you
-
- Posts: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: Keep a table on the same page
Post by radu_pisoi »
Hi,
I assume that you are talking about the DITA PDF customization.
In this case, a solution is to set the keep-together.within-page XSL-FO property for DITA tables.
This can be done by extending the attribute-set for the table element and add the keep-together.within-page attribute. The attribute set for the table is defined in DITA-OT/plugins/org.dita.pdf2/cfg/fo/attrs/tables-attr.xsl.
If you are using a DITA PDF customization plugin, you should specify the next attribute set in the DITA-PDF-Customization/fo/attrs/custom.xsl:
Make sure that the above XSLT file is referred from DITA-PDF-Customization/catalog.xml, the next line should be un-comment:
More details about DITA to PDF Output Customization could be found in our user manual.
I assume that you are talking about the DITA PDF customization.
In this case, a solution is to set the keep-together.within-page XSL-FO property for DITA tables.
This can be done by extending the attribute-set for the table element and add the keep-together.within-page attribute. The attribute set for the table is defined in DITA-OT/plugins/org.dita.pdf2/cfg/fo/attrs/tables-attr.xsl.
If you are using a DITA PDF customization plugin, you should specify the next attribute set in the DITA-PDF-Customization/fo/attrs/custom.xsl:
Code: Select all
<xsl:attribute-set name="table" use-attribute-sets="base-font">
<xsl:attribute name="keep-together.within-page">1</xsl:attribute>
</xsl:attribute-set>
Code: Select all
<!-- Custom attributes entry -->
<uri name="cfg:fo/attrs/custom.xsl" uri="fo/attrs/custom.xsl"/>
More details about DITA to PDF Output Customization could be found in our user manual.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 68
- Joined: Tue Jun 09, 2015 6:26 pm
- Location: Canada
Re: Keep a table on the same page
Post by BogdanM777 »
Thank you very much Radu.
I will try that. The only thing was that I did not know in which file to do the modification for keep-together-within-page.
I did it for other elements and it worked very nicely.
Have a great day
I will try that. The only thing was that I did not know in which file to do the modification for keep-together-within-page.
I did it for other elements and it worked very nicely.
Have a great day
-
- Posts: 86
- Joined: Wed Feb 09, 2011 10:43 pm
Re: Keep a table on the same page
Hello,
Pushing my luck, I wanted to do the same thing but for a codeblock.
I added this code in the custom.xsl file.
My reference to the customs.xsl file was already uncommented, So I figured I was in business.
But it did not work.
Is it because it's just not possible to do that? or am I missing something.
Pushing my luck, I wanted to do the same thing but for a codeblock.
I added this code in the custom.xsl file.
Code: Select all
<xsl:attribute-set name="codeblock" use-attribute-sets="pre">
<xsl:attribute name="keep-together.within-page">1</xsl:attribute>
</xsl:attribute-set>
But it did not work.

Is it because it's just not possible to do that? or am I missing something.
-
- Posts: 86
- Joined: Wed Feb 09, 2011 10:43 pm
Re: Keep a table on the same page
Well,
actually it works for the codeblock if I use
instead of
I suspect we can probably do this for any element......

Code: Select all
<xsl:attribute name="keep-together.within-page">always</xsl:attribute>
Code: Select all
<xsl:attribute name="keep-together.within-page">1</xsl:attribute>
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