【问题标题】:display table header on each page print在每页打印上显示表格标题
【发布时间】:2016-03-24 22:14:29
【问题描述】:

我有我的表格标题内容,我想在溢出的表格正文数据的每一页上打印这些内容。我尝试了 thead display: table-header-group 但它似乎没有帮助。关于如何使其在 IE10 或 chrome 中工作的任何建议?

HTML。

<table>
  <thead>
       <div>
          My print content
       </div>
  </thead>
  <tbody>
        <tr> Test <tr>
        <tr> Test <tr>
        ...
   </tbody>
</table>

【问题讨论】:

  • 对于&lt;thead&gt; 允许的内容:零个或多个&lt;tr&gt; 元素。
  • 我确实在第一页打印了 div 内容,但是我想在后续打印页面上重复标题内容。
  • 您目前拥有的是无效的 HTML,如果您得到纠正,它可能会起作用。

标签: html css print-css


【解决方案1】:

请改用&lt;tr&gt;&lt;td&gt;My print content&lt;/td&gt;&lt;/tr&gt;。 thead 只带 tr 里面,tr 只带 td 里面

【讨论】:

  • 这里的问题是 div 或 tr 我能够打印第一页打印的表头。但是在随后的打印页面上,我无法重复标题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-01-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-03-08
相关资源
最近更新 更多