Trying to bend page breaks to my will
In short: I have an invoice in HTML. The document consists of a header, a table of invoice lines, a totals area, and a payment instruction area.
When the invoice contains too many invoice lines for it to be on one page, I want the invoice to do a page break in the invoice line table.
And it does just that when I put in many lines, so that's good. But if I put in just the right amount of lines, the page break is between the table and the totals, which I do not want. In this case I want the page break to be in the table as well.
Basically the only place I want a page break is in the table.
I tried something like this:
But then the page break happens before the table.
In short: I have an invoice in HTML. The document consists of a header, a table of invoice lines, a totals area, and a payment instruction area.
When the invoice contains too many invoice lines for it to be on one page, I want the invoice to do a page break in the invoice line table.
And it does just that when I put in many lines, so that's good. But if I put in just the right amount of lines, the page break is between the table and the totals, which I do not want. In this case I want the page break to be in the table as well.
Basically the only place I want a page break is in the table.
I tried something like this:
* {
page-break-before: avoid;
page-break-after: avoid;
page-break-inside: avoid;
}
table {
page-break-before: avoid;
page-break-after: avoid;
page-break-inside: auto;
}
But then the page break happens before the table.
Edited by rohde