html - 如何防止所有页面都打印thead

标签 html css printing

我想知道是否有可能,当用户开始打印 html 页面时,防止在所有页面上打印表格的 thead

这是因为我在表格前面的元素上使用了 page-break-after: always;,因此我的表格标题也打印在第一页上...

我无法用 tr 替换我的 thead,因为我的代码的硬部分位于那个 thead 上。

最佳答案

使用 THEAD,您无法做到这一点。但是你可以尝试申请display: table-row<thead>但它不适用于所有浏览器

When long tables are printed, the head and foot information may be repeated on each page that contains table data (official docs)

关于html - 如何防止所有页面都打印thead,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40018225/

相关文章:

javascript - 计算具有多个变量的旅程成本总价

css - SVG 填充颜色不起作用

c# - 使用 PrintDocument 时出错

javascript - 确定位于单元格下方的表列中的单元格

php - 创建邀请码发送到数据库

html - 摇动悬停菜单栏

html - 在 div 中调整图片大小和对齐图片

html - 我无法调整文本大小

c# - 在多页上打印一封信

css - 如何在不同浏览器中打印多页 HTML 表格