Dompdf: Footer not displaying on every page when rendering a large table

Created on 24 Dec 2019  路  3Comments  路  Source: dompdf/dompdf

Hy! I have a large table in my HTML view. I have referred the #1190 issue and set styles position:fixed;bottom:0 for my footer. But the footer is only displaying on the last page.

CSS

           @page { margin: 100px 25px; }
            header { position: fixed; top: -60px; left: 0px; right: 0px; }
            footer { position: fixed; bottom: 0px; left: 0px; right: 0px; }
            table { page-break-inside:auto }
            tr    { page-break-inside:avoid; page-break-after:auto }
            thead { display:table-header-group }
            tfoot { display:table-footer-group }
            body {
                padding-top:150px;
                font-family: sans-serif;
                padding-bottom: 150px;
            }
            .pagenum::before {
                content: "Page " counter(page) " of " counter(pages);
            }

Most helpful comment

The issue was resolved after placed footer content above from the table contents.

Wrong

<header ..... >
<table ....>
<footer ...>

Right

<header ..... >
<footer ...>
<table ....>

All 3 comments

The issue was resolved after placed footer content above from the table contents.

Wrong

<header ..... >
<table ....>
<footer ...>

Right

<header ..... >
<footer ...>
<table ....>

For me this leaves a footer on page one and not page 2.
I had to do:

<header ..... >
<footer ...>
<table ....>
<footer ...>

Not sure why, but it works for page 2.

any solution for this? i only get header and footer on first page

Was this page helpful?
0 / 5 - 0 ratings