相关疑难解决方法(0)

HTML/CSS:打印表时空页+唯一页眉页

我无法理解为什么在本文档中有一个空白页面+一个只包含表格标题的页面.

在此输入图像描述

其余的还可以,但我无法摆脱这两页.

这是完整的HTML代码:

<!DOCTYPE html>
<html lang="en" >
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <style media="print" type="text/css">

h1:not(:first-child) {
    page-break-before: always;
}

table {
    page-break-before : avoid;
    page-break-inside : avoid;
    padding: 0;border-collapse: collapse; }
table tr {
    border-top: 1px solid #cccccc;
    background-color: white;
    margin: 0;
    padding: 0; }
table tr:nth-child(2n) {
    background-color: #f8f8f8; }
table tr th {
    font-weight: bold;
    border: 1px solid #cccccc;
    margin: 0;
    padding: 6px 13px; }
table tr td {
    border: 1px solid #cccccc;
    margin: 0;
    padding: 6px …
Run Code Online (Sandbox Code Playgroud)

html css printing

3
推荐指数
1
解决办法
2048
查看次数

标签 统计

css ×1

html ×1

printing ×1