In fact, the answer that is selected as accepted (from Phil Ross) is missing one detail ...
it works in Chrome and the solution is really stupid !!
Both the parent and the element you want to control page breaks should be declared as:
position: relative
check out this script: http://jsfiddle.net/petersphilo/QCvA5/5/show/
This is true for:
page-break-before page-break-after page-break-inside
However, paging control inside Safari does not work (at least in 5.1.7)
Hope this helps !!!
PS: The question below explains the fact that recent versions of Chrome no longer respect this, even with the position: relative; trick. However, they seem to respect:
-webkit-region-break-inside: avoid;
see this fiddle: http://jsfiddle.net/petersphilo/QCvA5/23/show
so I think we should add this now ...
Hope this helps!
Peter Sep 12 2018-12-12T00: 00Z
source share