Reputation: 506
I'm using html and FreeMarker in order to create a pdf.
I have to print many pages and add a table on the bottom part of the last page. I'm already using a footer on each page
<body header="nlheader" header-height="180px" footer="nlfooter" footer-height="80px" padding="0.5in 0.5in 0.5in 0.5in" size="A4">
<table class="body" style="width: 100%; margin-top: 10px;">
<#--- Body table --->
</table>
<table class="recap">
<#--- Table to keep at the bottom --->
</table>
Upvotes: 0
Views: 1500
Reputation: 639
There's a lot of ways to do this, but this is the best one I think, I also use it personally:
Check out the snippet bellow:
*{/* those only to remove margins */
margin:0;
padding:0;
box-sizing:border-box;
}
html,body{/* make sure to give html and body 100% height */
height:100%;
}
.container{
display:flex;
flex-direction:column;
justify-content:space-between;
height: calc(100% - 45px); /* 100% - footer height (thats the available space)*/
/* Change the 45px to the footer height */
}
footer{/* footer sample */
height:45px;
background-color:#223;
color:#fff;
}
<html>
<body>
<div class="container">
<table class="body" style="width: 100%; margin-top: 10px;">
<td><#--- Body table ---></td>
</table>
<table class="recap">
<td><#--- Table to keep at the bottom ---></td>
</table>
</div>
<footer>This is the footer</footer>
</body>
</html>
Upvotes: 1