CSS printing multiple pages of a table with a record

I need to print a large HTML table that goes through several pages. Each page should have an inscription (header and footer with company names, etc.). I use jQuery-datatableswith TableTools. Here is my css

@media print
{
    @page{
        margin: 150px 0px 150px 0px !important;
        padding: 0px !important;
        size: A4 portrait;
    }

    table { page-break-after:auto;}
    tr    { page-break-inside:avoid; page-break-after:auto }
    td    { page-break-inside:avoid; page-break-after:auto }
    thead {
        display:table-row-group;
    }
    html{
        background-image: url(memo.png) !important;
        background-size: 200mm 287mm !important;
    }
}

However, when you set the top edge to, @pageit "moves" all (including) the background down. I wonder if there is a way to apply margin from @pageto the table, but to avoid this when setting the background or adding a background image to@page

I also tried setting the marker @pageto 0 and table150 pixels. This is good on the first page, but since the table is divided into several pages, it ignores fields on other pages.

UPDATE

enter image description here

. , - , -

+4
1

( ) <thead>? 150 . ​​

, . , , .

<tfoot>, , .

0

Source: https://habr.com/ru/post/1613510/


All Articles