Firefox不会在第2页及以后的页面上打印表格边框 [英] Firefox does not print table borders on pages 2 and onwards

查看:128
本文介绍了Firefox不会在第2页及以后的页面上打印表格边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:

在Mozilla Firefox(版本55.0.3 32位)上打印表格时,表格边框仅显示在首页上,而不显示在任何后续页面上.

When printing a table on Mozilla Firefox (version 55.0.3 32bit), table borders show on the first page only, but not on any of the subsequent pages.

因此,即打印第2页仅不打印表格边框,而打印第1页仅打印表格边框.

So, i.e. printing pages 2 only does not print table borders, but printing page 1 only prints table borders.

此问题无济于事: https://webmasters.stackexchange.com/questions/2578/how-to-prevent-table-borders-from-disappearing-while-printing (将接受的答案的CSS插入后,在第2页及以后的页面上仍不打印边界我的页面)

This question did not help: https://webmasters.stackexchange.com/questions/2578/how-to-prevent-table-borders-from-disappearing-while-printing (borders are still not printing on page 2 and onwards, after inserting accepted answer's CSS into my page)

这就是我所拥有的:

<table class="listdb">...</table>

table.listdb {
  font-size: 10pt;
  border-width: 0px 0px 0px 0px;
  border-spacing: 0px;
  border-style: none;
  border-color: #000000;
  border-collapse: collapse;
  background-color: #FFFFFF;
}

table.listdb th {
  font-size: 10pt;
  border-width: 1px;
  padding: 1px 5px 1px 5px;
  border-style: solid;
  border-color: #000000;
  background-color: #7A99DD;
  color: #000000;
  vertical-align: top;
}

table.listdb td {
  font-size: 10pt;
  border-width: 1px;
  padding: 1px 5px 1px 5px;
  border-style: solid;
  border-color: #999999;
  border-color: #000000;
  vertical-align: top;
}

我还尝试使用下面的HTML5 Boilerplate的CSS-并没有帮助(当我使用整个@media print块时,在此处显示相关摘录)

I also tried using HTML5 Boilerplate's CSS below - didn't help (showing relevant excerpt here, when I used entire @media print block)

@media print {
    /*
     * Printing Tables:
     * http://css-discuss.incutio.com/wiki/Printing_Tables
     */

    thead {
        display: table-header-group;
    }

    tr,
    img {
        page-break-inside: avoid;
    }    
}

推荐答案

这有效

<style>
<!--
@media print {
    table.listdb {
        border-collapse: unset;
    }
}
-->
</style>

在我的表<table class="listdb">...</table>

这篇关于Firefox不会在第2页及以后的页面上打印表格边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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