for example, I have two tables: table1 and table 2, the are rendered in one html page, when print, table 1 is half page height, and table 2 is one and half page height. I add page-break-inside on both tables, when print with PDF, table 2 actually is not start with a new page, but after the table 1 in the same page. Interesting thing is, if table2 is one or less than one page height, it will start with new page.
Is this a bug? or just by design of pd4ml? I’m really confused.
page-break-inside: avoid protects HTML element from being split.
It forces a page break before table2 if there is a chance to keep table2 not broken. If table2 height is higher than page height – it does not force a page break, as the table will be broken in any case. If also does not force a page break if table2 fits the remaining space on a page.
So if I understand you correctly, it works on your side as it should do.
If you need to force a page break, you may use tag or page-break-before: always CSS style applied to a block element.