相关疑难解决方法(0)

在第二页和后面的页面上,Chrome 53打印表标题的解决方法是两次?

我网站的用户需要能够打印包含第一页打印页面上的内容的网页,然后是第二页上的表格.精简版是(jsFiddle at https://jsfiddle.net/jaydeedub/n3qhvtvx/25/):

HTML:

<body>
  <button class="button" onclick="window.print()">Print Me</button>
  <div class="page1">
    This is the page 1 content. Blah, blah, blah.
  </div>
  <table class="table">
    <thead>
      <tr>
        <td>Page 2 table header prints twice</td>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>Page 2 table body</td>
      </tr>
    </tbody>
    <tfoot>
      <tr>
        <td>Page 2 table footer</td>
      </tr>
    </tfoot>
  </table>
</body>
Run Code Online (Sandbox Code Playgroud)

CSS:

@media print {
  div.page1 {
    page-break-after: always;
  }
}

.table {
  border-collapse: collapse;
  margin: 16px;
}

.table>thead>tr>td,
.table>tbody>tr>td,
.table>tfoot>tr>td {
  border: 1px solid black;
}

.button { …
Run Code Online (Sandbox Code Playgroud)

printing google-chrome html-table

16
推荐指数
1
解决办法
5168
查看次数

标签 统计

google-chrome ×1

html-table ×1

printing ×1