My html is having this kind of structure :
<div>
<div class="pagebr">content1</div>
<div class="pagebr">content2</div>
<div class="pagebr">content3</div>
<div class="pagebr">content4</div>
<div class="pagebr">content5</div>
<div class="pagebr">content6</div>
<div class="pagebr">content7</div>
</div>
All the inner Div
elements are coming dynamically. Sometimes there will be one or two div
or may be all. It is not fixed. But total are 7.
When I write class -
div.pagebr
{
page-break-after:always;
}
Every div move to next new page creating empty space after div
element.
page-break-before:always;
does the same and page-break-after:auto;
is not working anymore.
How should I add class for the Div elements, so that they can be fit on each page without breaking? Or is there any alternate solution?
Any help is appreciated. Thanks.