如何使用“page-break-inside”对于 tbody 标签?
我有一个使用 wkhtmltopdf 工具转换为PDF的HTML文件。 我正在使用页面break-inside:避免
样式以逃脱页面包装(如果表格上没有位置的表格,则整个表格为新的PDF页面),并且它非常适合桌子。
问题是
我有这样的
<table >
<caption>Payments</caption>
<tbody>
<tr>
<th>line 1</th>
<td>100.00</td>
</tr>
<tr>
<th>line1 note 1</th>
<td>120.00</td>
</tr>
<tr>
<th>line1 note 2</th>
<td>20.00</td>
</tr>
</tbody>
<tbody>
<tr>
<th>line 2</th>
<td>100.00</td>
</tr>
<tr>
<th>line2 note 1</th>
<td>120.00</td>
</tr>
<tr>
<th>line2 note 2</th>
<td>20.00</td>
</tr>
</tbody>
</table>
表不在桌子旁。我希望新的Tbody块从新页面开始(而不是在当前页面上没有位置,而不是在Tbody Block内部开始)。
I have an HTML file that I convert to PDF using the Wkhtmltopdf tool.
I am using page-break-inside: avoid
style to escape table wrapping in pages (if there is no place on the current page for the table the whole table goes to a new pdf page), and it works great for tables.
The question is
I have this kind of table
<table >
<caption>Payments</caption>
<tbody>
<tr>
<th>line 1</th>
<td>100.00</td>
</tr>
<tr>
<th>line1 note 1</th>
<td>120.00</td>
</tr>
<tr>
<th>line1 note 2</th>
<td>20.00</td>
</tr>
</tbody>
<tbody>
<tr>
<th>line 2</th>
<td>100.00</td>
</tr>
<tr>
<th>line2 note 1</th>
<td>120.00</td>
</tr>
<tr>
<th>line2 note 2</th>
<td>20.00</td>
</tr>
</tbody>
</table>
where each block is tbody inside one big table, as the block can be too long and it can be bigger than one pdf page I want to wrap it by tbody, not by the table. I want the new tbody block to start from the new page (instead of cutting inside tbody block) if there is no place on the current page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论