打印时每页上的分页符和表头。打印表css问题 [英] Page break and table head on each page when printing. Print Table css issues

查看:459
本文介绍了打印时每页上的分页符和表头。打印表css问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在列印表格,无法找出几个问题:


  1. 表格行上的分页符号


  2. 链接到演示:



    https:// jsfiddle.net/DTcHh/18144/



    代码:

      @media print {

    / *不起作用* /
    thead {display:table-header-group!important;}
    tr {page- break-inside:avoid!important;}
    }

    / p>

    感谢

    解决方案

    这对我有用,希望它能帮助: / p>

      table tr {
    -webkit-column-break-inside:avoid!important;
    page-break-inside:avoid!important;
    break-inside:avoid!重要;
    display:table; / * this did it * /
    }


    I am printing a table and can't figure out a couple of issues:

    1. Page break on a table row to stop it printing half on 2 pages
    2. Print the thead section on every page at the top.

    Heres a link to the demo:

    https://jsfiddle.net/DTcHh/18144/

    Heres the code:

    @media print {
    
       /* doesn't work */
        thead {display: table-header-group !important;}
        tr {page-break-inside: avoid !important;}
    }
    

    Any help would be greatly appreciated

    Thanks

    解决方案

    This worked for me, hope it helps:

    table tr {
            -webkit-column-break-inside: avoid !important;
            page-break-inside: avoid !important;
            break-inside: avoid !important;
            display: table; /* this did it*/
        }
    

    这篇关于打印时每页上的分页符和表头。打印表css问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆