微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

wkhtmltopdf – 长桌的分页符

我有一个长表,显示几页上的行.当页面结束时,该行在一页上打印一半,在下一页打印一半.如何确保在新页面上完整打印行?

解决方法

CSS属性:page-break-inside:avoid;在 HTML tr元素上做到了.

经测试:
wkhtmltopdf 0.12.3为Linux(Ubuntu Trusty)提供32位/ 64位,基于Ubuntu 14.04.2构建,如下所示:
http://wkhtmltopdf.org/downloads.html#stable

快速而肮脏的测试可能如下所示:

<tr style="page-break-inside: avoid;">
  <!-- A little border to see the result more easily -->
  <td style="border: solid 1px blue;">
    Large text possibly displayed on several pages ... 
    Large text possibly displayed on several pages ... 
    Large text possibly displayed on several pages ... 
    Large text possibly displayed on several pages ... 
  </td>
  <td>col2</td>
  <td>col3</td>
</tr>

Mozilla Developer Network page-break-inside description

原文地址:https://www.jb51.cc/html/242564.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐