0
I have a script from a legacy system that creates a table with the data coming from the php database. The script was developed to store everything in a $html tag and at the end give an echo.
At the end of this script there is a footer element with place for the employee to sign. Client asked that this footer be at the end of every page that is printed.
So far so good. I put the div with css below:
div.footer {
position: fixed;
bottom: 0;
}
and the table with the following configuration for page break if the "line" exceeds the end of the page:
table { page-break-inside:auto; margin-bottom: 10px; }
tr { page-break-inside:avoid; page-break-after:auto; }
thead { display:table-header-group }
tfoot { display:table-footer-group }
Everything works nicely except for the fact that the footer element overwrites the last row of the table on certain pages where the table picks up the entire page height.
Is there any way to avoid that? I tried some forms with javascript and css but as the number of footer elements is one, even though it is printed in 3, 4, 5 pages, I still can’t get.
<html>
<head>
<style type="text/css" media="print">
table { page-break-inside:auto; margin-bottom: 10px; }
tr { page-break-inside:avoid; page-break-after:auto; }
thead { display:table-header-group }
tfoot { display:table-footer-group }
div.footer {
position: fixed;
bottom: 0;
}
</style>
</head>
<body>
<table>
...
</table>
<div class='footer'>
<label style='font-family:verdana;font-size:10px;font-weight:bold;'>Assinatura: _______________________________________________<br>Por ser verdade, assino e dou fé ao presente documento</label>
<div id='pages' class='pages'></div>
</div>
</body>
</html>
Dude I think I may have a solution for you, but edit your question put enough code so that I can at least simulate the problem you’re having there, without it can’t help you much
– hugocsl
@hugocsl ok. Basically this is what I edited. The table is dynamically created in the database data looping. Out of this looping is the footer I put fixed at the time to print out on all sheets.
– A52
I published a solution to which you can adjust the values to be closer than you need
– hugocsl