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-datatables
with 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, @page
it "moves" all (including) the background down. I wonder if there is a way to apply margin from @page
to the table, but to avoid this when setting the background or adding a background image to@page
I also tried setting the marker @page
to 0 and table
150 pixels. This is good on the first page, but since the table is divided into several pages, it ignores fields on other pages.
UPDATE
. , - , -