Chrome会两次打印表格标题

时间:2016-10-03 13:19:52

标签: html css google-chrome

我在Google Chrome上遇到了一个奇怪的错误(版本53.0.2785.143)。当我尝试打印页面内容时,它会包含一个表格标题两次。

表头只应在底部显示一次。

图像:

enter image description here

在不同的部分,表头流过表行。

enter image description here

我正在使用打印媒体查询,以便只打印我的页面内容:

@media print {
table { 
    page-break-inside:auto 
}
tr { 
    page-break-inside:avoid; page-break-after:auto 
}
body * {
visibility: hidden;
}
.no-padding-small{
    padding: 0!important;
}
.stage, .progress-indicator {
display: none;
}
 #header{
display: none;
 }
.fixed-menu{
display: none;
}
.printable * {
visibility: visible;

}
 textarea, input[type], table, td, th, tr{
page-break-inside: avoid;
 }
}

有什么建议吗?

1 个答案:

答案 0 :(得分:6)

找到解决方案:

thead {
display: table-row-group;

}

感谢这个帖子Workaround for Chrome 53 printing table header twice on 2nd and later pages?