我正在尝试使用 SelectPDF 从剃刀页面 HTML 页面生成 PDF。此 html 是动态生成的报告,因此任何给定的表中都可以包含任意数量的元素。
有没有办法确保当表格包含太多行以适应一页时,表格停止,插入分页符,然后在下一页重新开始,而不是像没有分页符一样继续那里?
实际上,如何使表格中间的分页符看起来很漂亮?
我在使用 html 渲染功能时遇到了同样的问题,这对我有用,但是我必须使用带有重复表头的分页符样式才能获得可接受的结果。
<table border="1" style="page-break-inside: avoid;">
<thead style="display: table-header-group; page: auto">
</thead>
<tbody>
table code
</tbody>
相关链接:
此链接将帮助您 使用“page-break-before”、“page-break-after”或“page-break-inside”来选择PDF 。
<div style="page-break-after: always">
A page break will be inserted AFTER this div element because "page-break-after"
property is set to "always".
</div>