表格从下一页开始,而不是在同一页中中断,如果我减少几行或添加几行,它会正确中断。
我在父容器和表行中有
break-inside: avoid;
break-inside: avoid; page-break-inside:avoid; page-break-after:auto;
网址 https://kaingaora-pricelist.co.nz/pdf-test/display
CSS 代码看起来像
.single-block * {
page-break-inside: avoid;
break-inside: avoid;
}
table tr, table .tr {
break-inside: avoid;
page-break-inside: avoid;
page-break-after: auto;
}
我正在使用
phpwkhtmltopdf 2.5
使用的命令 wkhtmltopdf https://kaingaora-pricelist.co.nz/pdf-test/display pdftest.pdf
调整表格的分页符属性
.single-block * {
page-break-inside: auto;
break-inside: auto;
}
table, table tr, table .tr {
page-break-inside: auto;
break-inside: auto;
page-break-after: auto;
}
重新定义父容器的属性如果.single-block类是父容器,您可能需要调整或删除page-break-inside:avoid;和闯入:避免;