首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用wkhtmltopdf将表头与第二页上的内容重叠时转换为PDF

使用wkhtmltopdf将表头与第二页上的内容重叠时转换为PDF
EN

Stack Overflow用户
提问于 2016-09-01 16:06:11
回答 2查看 7.5K关注 0票数 2

我有一张横跨多页的桌子。头版在第二页重复,内容重叠。

我正在使用引导,并确保来自其他wkhtmltopdf重叠解决方案的css在我的页面中实现。

代码语言:javascript
运行
复制
thead { display: table-header-group; }
tfoot { display: table-row-group; }
tr { page-break-inside: avoid; }

table, tr, td, th, tbody, thead, tfoot, td div {
    page-break-inside: avoid !important;
}
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-09-01 16:06:11

该表被包装在一个<div class="table-responsive">中。这是引起问题的原因。

我添加了以下CSS以更改表响应的div上处理overflow的方式。

代码语言:javascript
运行
复制
.table-responsive { overflow-x: visible !important; }

这解决了我的问题。

基思

票数 9
EN

Stack Overflow用户

发布于 2022-02-23 10:55:39

这对我有用。在本表中:

代码语言:javascript
运行
复制
<table class="webgrid-table">
 <thead>
  <tr>
   //your code
  </tr>
 </thead>
</table>

只添加以下css类:

代码语言:javascript
运行
复制
.webgrid-table thead {
    display: table-header-group;
}

.webgrid-table tfoot {
    display: table-row-group;
}

.webgrid-table tr {
    page-break-inside: avoid;
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39276254

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档