CSS 表格打印页面 bug……
哇……因为这个问题,我真的白白浪费了超过 16 个小时。\ CSS 表格打印时。 有些人会在打印时使用 table。 无论是生成 PDF 还是做什么。 但是,在这里,如果超过 2 页,有时 tr 的高度值会异常地变大。 原因是使用了 display: flex;。在 table 里面,无论是在 div 还是其他地方,只
GGAMI
哇……因为这个问题,我真的白白浪费了超过 16 个小时。
CSS 表格打印时。
有些人会在打印时使用 table。
无论是生成 PDF 还是做什么。
但是,在这里,如果超过 2 页,有时 tr 的高度值会异常地变大。
原因是使用了 display: flex;。在 table 里面,无论是在 div 还是其他地方,只要使用 flex,在超过 2 页的打印区域中,就一定会在页面分页的末尾部分出现问题。
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1524#issuecomment-708958565
At the root of my page, I had display: flex; container. It was exactly the reason why none of the previous answers worked for me.
@media print { display: block; } for that container worked like a charm in my case.
I'm fully aware, you might need display: flex for print version of your page. Just wanted to let you know that was the root cause of the problem.