I have multiple tables that fill dynamically.
I want to print header on every pages in print mode, But when a table rows doesn't fit on the page they print on the next page and my header print on them. Like this : This is my print preview
how can I set a margin between page header and pages data?
I searched a lot but nothing seems to work, even position:fixed doesn't work as expected.
@page {
size: A4;
margin-left: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-top: 0px;
}
@media screen {
.header {
display: none;
}
}
@media print {
.header {
position: fixed;
top:10px;
width:100%;
margin:10px;
border: 3px solid #000;
}
}
Sample Html:
<table class="header">
<tr>
<td>
This is my header table
</td>
</tr>
</table>
<table>
....
</table>
<table>
....
</table>
and more...