Table headers overlapping content on second page when converting to PDF with wkhtmltopdf

有些话、适合烂在心里 提交于 2020-01-17 12:13:05

问题


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

回答1:


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



来源:https://stackoverflow.com/questions/39276254/table-headers-overlapping-content-on-second-page-when-converting-to-pdf-with-wkh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!