Page-Break-inside property is not working in chrome

前端 未结 2 1260
礼貌的吻别
礼貌的吻别 2021-01-18 06:28

I have a long table data, which having many of the rows and nested tables. When I am printing this data then the rows of the table and nested tables are just break on the pa

相关标签:
2条回答
  • 2021-01-18 06:40

    Instead of putting the page-break-inside:avoid; on you table's tr, try applying it on the table directly like this:

    table {
        page-break-inside:avoid;
        position:relative;
    }
    

    also add this media query:

    @media print {
       table {
            page-break-inside:avoid;
            position:relative;
        }
    }
    
    0 讨论(0)
  • 2021-01-18 06:53

    This did the trick for me it turned out to be the body css:

    body{
        height: auto!important;
        float: none!important;
    }
    
    0 讨论(0)
提交回复
热议问题