使用 wkhtmltopdf 转换为 PDF 时,表格标题与第二页上的内容重叠 [英] Table headers overlapping content on second page when converting to PDF with wkhtmltopdf

查看:72
本文介绍了使用 wkhtmltopdf 转换为 PDF 时,表格标题与第二页上的内容重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个跨越多个页面的表格.标题在第二页上重复出现并与内容重叠.

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

thead { display: table-header-group;}tfoot { 显示:表行组;}tr { page-break-inside:避免;}表,tr,td,th,tbody,thead,tfoot,td div {page-break-inside: 避免 !important;}

解决方案

表格被包裹在

中.这导致了问题.

我添加了以下 CSS 以更改在 table-responsive div 上处理溢出-x 的方式

.table-responsive { 溢出-x:可见!重要;}

这解决了我的问题.

基思

I have a table that is spanning across multiple pages. The thead is being repeated on the second page and is overlapping the content.

I am using bootstrap and have ensured the css from other wkhtmltopdf overlap solutions are implemented in my page.

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;
}

解决方案

The table was wrapped in a <div class="table-responsive">. This was causing the issue.

I added the following CSS to change how overflow-x was handled on the table-responsive div

.table-responsive { overflow-x: visible !important; }

This fixed my issue.

Keith

这篇关于使用 wkhtmltopdf 转换为 PDF 时,表格标题与第二页上的内容重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆