DITA to PDF Using HTML5 and CSS: Table Row Breaks
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 53
- Joined: Sat May 22, 2021 6:04 pm
DITA to PDF Using HTML5 and CSS: Table Row Breaks
Post by patjporter »
Hello,
I have been studying your Oxygen PDF Chemistry user guide and researching on the internet, but I cannot figure out how to prevent rows from breaking across a page. Can you help me understand what to set in the CSS to prevent this (a row should start on the next page if it is going to break across a page):
I added this to the CSS but that did not prevent the page break:
/*prevent-table-row-page-break*/
@media print {
row {
page-break-inside: avoid;
}
}
Also, how would I add more padding between a table and the top of the page?
Thanks!
Pat
I have been studying your Oxygen PDF Chemistry user guide and researching on the internet, but I cannot figure out how to prevent rows from breaking across a page. Can you help me understand what to set in the CSS to prevent this (a row should start on the next page if it is going to break across a page):
Screen Shot 2021-10-10 at 11.58.27 AM.png
I added this to the CSS but that did not prevent the page break:
/*prevent-table-row-page-break*/
@media print {
row {
page-break-inside: avoid;
}
}
Also, how would I add more padding between a table and the top of the page?
Thanks!
Pat
You do not have the required permissions to view the files attached to this post.
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: DITA to PDF Using HTML5 and CSS: Table Row Breaks
There are some examples here:
https://www.oxygenxml.com/doc/versions/23.1/ug-pdf-css/
https://www.oxygenxml.com/doc/versions/ ... e_breaking
I will add an example specific to the rows.
First of all, the elements from DITA topics are transformed into HTML elements that preserve the default DITA class attributes. For example the <row> element in your topic has the default class attribute "- topic/row" and it is transformed into HTML as a <td class="- topic/row row"/>. Thus you cannot match it with a simple element selector using the original DITA name, like:
Instead you have to use:
Since we forbid all page breaks inside the row, the contents will be "glued" togehter. Please make sure the contents of your rows does not exceed the height of the page, otherwise the row bleeds out of the page.
Many regards,
Dan
https://www.oxygenxml.com/doc/versions/23.1/ug-pdf-css/
https://www.oxygenxml.com/doc/versions/ ... e_breaking
I will add an example specific to the rows.
First of all, the elements from DITA topics are transformed into HTML elements that preserve the default DITA class attributes. For example the <row> element in your topic has the default class attribute "- topic/row" and it is transformed into HTML as a <td class="- topic/row row"/>. Thus you cannot match it with a simple element selector using the original DITA name, like:
Code: Select all
row {
page-break-inside: avoid;
}
Code: Select all
*[class ~= "topic/row"] {
page-break-inside: avoid;
}
Many regards,
Dan
Return to “DITA (Editing and Publishing DITA Content)”
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