css - 带有表格的页面在打印时会产生问题,即使我使用的是单独的打印 css?

标签 css xhtml printing

包含 tables 的页面在打印中制造问题? 第一页空白,如果页面有 <table>,则内容从第二页开始打印

如果table很长我想打印table每个打印页面上的标题。

    body{
        font: 8pt/1.5 Arial, "Helvetica Neue", Helvetica, sans-serif;
        background: white;

    }

    #wrap-threeContainer, #wrap-twoContainer, #header {width: auto; 
        padding-top:1em;background:none}

    #wrap-threeCenterColContainer, 
    #wrap-twoRightColContainer {margin:0;padding:0;width:auto;float:none}
    h1 {color:#000}

    #globalWrapper{
        width: auto; 
        margin: 0 2%;
        padding: 0; 
        border: 0;
        float: none !important;
        color: black; 
        background: transparent;
        }

    #dataContainer, #introTextContainer, #wrap-threeContainer h1  {width:100%}

    #top-bar, #primarynavcontainer, #breadcrumbsContainer, 
#footer, #wrap-threeLeftColContainer, #wrap-threeRightColContainer, 
#bannerContainer, p.update, .adobe-reader-download,
 #wrap-twoLeftColContainer {visibility:hidden; display:none}


      tr, td, th {page-break-inside:avoid}
      thead {display:table-header-group}

    a {color:#000000}



    a:link, a:visited {
        color: #520;
        background: transparent;
        font-weight: bold;
        text-decoration: underline;
        }
    #content a:link:after, #content a:visited:after {
       content: " (" attr(href) ") ";
       font-size: 90%;
       }

    div#dataContainer {

        }

    #header #logoContainer {
    position:static;
    }

    #header {border-bottom:1px solid #333}

最佳答案

毕竟我自己解决了这个问题。并与其他 SO 用户共享,因为它可能会有所帮助。

在我的屏幕 css 中为布局的 div 定义了 overflow:hidden 的任何地方,我都将所有实例覆盖为打印 css 中的 overflow:visible。并解决了问题。

关于css - 带有表格的页面在打印时会产生问题,即使我使用的是单独的打印 css?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3069647/

相关文章:

javascript - jquery addClass 在 1 次行为不当,在另一种情况下工作

html - 如何更改导航器的渲染字体

html - iOS11 + Webview - 滚动div中的图像消失,不要回来

css - 100% Div 高度问题

c - Windows 假脱机程序 API GetPrinter() 未返回正确填充的结构 PRINTER_INFO_6

html - 如何在 HTML/CSS 中更改 div 的背景颜色

html - 如何在其父元素旁边制作子菜单?

css - 将一个 div 变成一个链接

c# - 使用 GhostScript 打印 PDF

printing - 如何通过ZPL改变条码的字体大小?