Hi,
I am using the following rules to stop page breaks in the first two or last two rows of a table in order to prevent orphan rows.
table tr:nth-of-type(1),
table tr:nth-of-type(2) {
page-break-after: avoid;
page-break-inside: avoid;
}
table tr:nth-last-of-type(1),
table tr:nth-last-of-type(2) {
page-break-before: avoid;
page-break-inside: avoid;
}
It seems to work fine with long tables, but if I have a table with only 2 rows, the above rules always trigger a page break before my table even though it is not needed.
Any ideas?
Regards
Peter
I am using the following rules to stop page breaks in the first two or last two rows of a table in order to prevent orphan rows.
table tr:nth-of-type(1),
table tr:nth-of-type(2) {
page-break-after: avoid;
page-break-inside: avoid;
}
table tr:nth-last-of-type(1),
table tr:nth-last-of-type(2) {
page-break-before: avoid;
page-break-inside: avoid;
}
It seems to work fine with long tables, but if I have a table with only 2 rows, the above rules always trigger a page break before my table even though it is not needed.
Any ideas?
Regards
Peter