wkhtmltopdf线程重叠第二页上的内容

wkhtmltopdf thead overlapps content on second page

这是我的 PDF 结果的样子(请参阅第二页上重叠的 header):


代码很简单 HTML table,一个 TD 元素中包含很多内容。

<table>
  <thead>
    <tr>
      <th>BESCHREIBUNG</th>
      <th>PREIS</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Lots of TEST's</td>
      <td>1,40 EUR</td>
    <tr>
  </tbody>
</table>

我知道已经存在这个问题(以及其他一些问题):

wkhtmltopdf repeating thead headers overlapping content

其中的解决方案对我有用:

thead { display: table-header-group; }
tfoot { display: table-row-group; }
tr { page-break-inside: avoid; }

然而,它仅适用于 table 多行 (tr)。

在我的例子中,正如您在上面看到的,我有一个 TD,其描述可以包含很多内容,因此一行将跨越多个页面。

是否也有针对这种特殊情况的解决方案?

如果您将您的描述分成许多部分作为一个字符串数组,您所拥有的解决方案将会奏效。并在 tr.

中打印每件