I have a table with variable number of rows. I want to print that table via browsers. Below it, there's a div that should remain at the bottom of the page. If the table is contained in the first page, the div will be at bottom of the first page. If the table overflow to the second page, the div will be a the bottom of the second page and so on,... My first approach was to handle it like I used to do in HTML
.footer{
width: 100%;
position: absolute;
bottom: 0;
font-size: 10pt;
}
This is not working. the footer remain on the first page. Need your help, please!
EDIT
I made the table and the footer in a parent div so that they can loop. A footer will always be on the same page as the end of a table. Sorry, for my inaccuracy!
SOLVED [EDITED]
I finally made it by surrounding the footer by another div and doing some CSS as follow:
.table{
min-height: 20cm !important;/* Define height for the table in cm or mm (I encountered a problem with px and %) */
display: block;
position: relative;
width: 100% !important;
}
.footer{
width: 100%;
position: relative;
margin-bottom: 0 !important;
font-size: 10pt;
page-break-inside: avoid !important;
page-break-before: auto !important; /* this pushes the footer to the bottom of next page if table overflows to another page */
}
The only remaining problem is when the table matches exactly the first page: the footer is pushed to the next page but is displayed on the top :( Thank you for all of your answers guys! :)