wkhtmltopdf – 长桌的分页符

前端之家收集整理的这篇文章主要介绍了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

猜你在找的HTML相关文章