Chrome将背景表颜色另存为pdf for HTML Table

时间:2019-04-10 18:40:35

标签: html css pdf html-table pdf-generation

当我以HTML显示表格时,我正在使用CSS:

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.4rem;
}

thead {
    background-attachment: fixed;
    background: var(--c);
}

thead > tr {
    line-height: 3.6rem !important;
    text-align: left;
    color: white;
}
thead th {
    position:relative;
}

它产生的外观如下:

Table in Browser

现在,如果我要在Chrome v73中打印并尝试将其保存为PDF,则生成的PDF具有以下内容:

Table after Save to PDF

也就是说,它已经创建了垂直单元格轮廓。看来Opera,Firefox和Safari也能产生相同的效果,因此必须与PDF呈现有关。

任何人都曾经见过此问题或知道解决方案吗?

0 个答案:

没有答案
相关问题