我想在每一页上打印一个带有双标题的表格。在第一页上它运行良好,但在接下来的页面上它只打印第一个标题。
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/