Page breaks not working as intended
Posted: Tue Apr 09, 2019 11:48 pm
Output type: PDF (DITA and CSS)
Our output has headers and footers on each page. In a section with a title and a table, adding the page-break-after: avoid; rule to the CSS doesn't seem to work, as a page break still occurs between the title and the table, leaving the title orphaned on the previous page.
XML sample:
CSS:
This applies it in the style.xml file but doesn't do anything in the PDF output. Same happens when saying instead to avoid the page break before a table in a section.
What are we doing wrong here?
Our output has headers and footers on each page. In a section with a title and a table, adding the page-break-after: avoid; rule to the CSS doesn't seem to work, as a page break still occurs between the title and the table, leaving the title orphaned on the previous page.
XML sample:
Code: Select all
<section id="section_A14D76328D3D46BFAF90699A6C230D3B">
<title> Impacted Outputs</title>
<table id="table_9C88C933C38D41C0A7C963D7C771975D">
<tgroup cols="3"><colspec colnum="1" colname="col1"
colwidth="1.5in"/><colspec colname="col02" colnum="2" colwidth="2in"/><colspec
colnum="3" colname="col2" colwidth="3.35in"/><thead>
<row>
<entry colname="col1">Output Type
</entry>
<entry colname="col02">Output Name
</entry>
<entry colname="col2">Details
</entry>
</row></thead>
<tbody>
<row>
<entry colname="col1">
<p>Reports and Files – New
</p>
</entry>
<entry colname="col02">
<ul id="ul_bgv_bwh_qfb">
<li id="li_CF0EC43F5EC14FE4B1223B06FBFCCCF0">XXXX Incoming
File
</li>
<li id="li_DCF78F615A9C434B879846697B1F3DF7">XXXX Outgoing
File
</li>
</ul>
</entry>
<entry colname="col2">
<p>The XXXX Incoming File and the XXXX Outgoing File support the exchange of XXXX information
between XXXX and XXXXX</p>
</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
Code: Select all
*[class~="topic/section"] > *[class~="topic/title"] {
display: block;
text-align: left;
font-size: 10pt;
font-family: "Segoe UI", helvetica, sans-serif;
font-weight: bold;
page-break-after: avoid;
}
What are we doing wrong here?