【问题标题】:<THEAD> is not being honored when using Print Preview with a CHtmlView control将打印预览与 CHtmlView 控件一起使用时,不支持 <THEAD>
【发布时间】:2018-03-13 20:05:59
【问题描述】:

我有一个基本的 HTML table 对象,它有一个 thead 部分:

<thead>
    <tr>
        <td class="columnStudyPoint">Study Point</td>
        <td class="columnDate">Date Assigned</td>
        <td class="columnDate">Date Completed</td>
    </tr>
</thead>

现在,如果我在 Microsoft Edge 中打开我的 HTML 文档并进行打印预览,我会发现它正在工作:

但是,我在 CHtmlView Web 浏览器控件中显示此 HTML 文档,该控件在后台使用 IE7。在这种情况下,thead 在执行打印预览时不会重复。

【问题讨论】:

    标签: html-table mfc webbrowser-control


    【解决方案1】:

    如果我将它添加到我的 CSS 文档中:

    @media print {
       thead {
           display: table-header-group;
       }
    
       table tbody tr td:before,
       table tbody tr td:after {
            content : "" ;
            height : 4px ;
            display : block ;
        }
    }
    

    CHtmlView 控件中第 2 页的预览:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多