html - 在所有页面上使用两个线程打印表头

标签 html css

我想在每一页上打印一个带有双标题的表格。在第一页上它运行良好,但在接下来的页面上它只打印第一个标题。

CSS

@media print {
    thead {
       display: table-header-group;
    }
}

我的表格的 HTML。

<tr>
   <thead>
      <th colspan="2">A</th>
      <th>B</th>
      <th>C</th>
   <thead>
      <th>1</th>
      <th colspan="2">2</th>
      <th>3</th>
</tr>

感谢您的帮助。

我尝试向第二个 thead 添加一个类,然后将其分组在 css 中而不是 thead -> .className 但它不起作用。我得到了相同的结果。

最佳答案

试试这个,

<thead>
   <tr>
      <th colspan="2">A</th>
      <th>B</th>
      <th>C</th>
   </tr>
   <tr>
         <th>1</th>
         <th colspan="2">2</th>
         <th>3</th>
   </tr>
</thead>

关于html - 在所有页面上使用两个线程打印表头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18735035/

相关文章:

javascript - 更改文本的功能不起作用 jQuery

html - 无法使用 Angular 带将 svg Logo 添加到导航栏

javascript - 背景尺寸 :cover doesn't work on iPhone 4 or 5

javascript - 固定菜单项

javascript - 具有初始静态状态的 Headroom.js header

jquery - 动态创建图像并根据百分比填充颜色

php - MySQL 和 PHP : summing up data from a table

HTML 表单 : issues combining charset with enctype in Firefox

Microsoft Edge 上的 CSS 可见性

css - Ionic 2 中央圆形标签