Forum How do I...?

Add footer with dynamic content

MiroMichail
How can i add footer with dynamic content? Now, if i try add footer with dynamic content it's will add only some lines not all. Several lines is cut.
jim_albright
do you have a short example?

Jim Albright
Wycliffe Bible Translators

mikeday
The @page margin-bottom must be big enough to fit the footer content.
MiroMichail
I'm add footer like this. I need fix margin from bottom
@page :nth(1) {
@bottom {
content: flow(footer);
margin-bottom: 20px;
}
}

#footer-template {
flow: static(footer)
}

<div id="footer-template">(dynamic text from PHP)</div>

But if text have dynamic number of lines, some of line is cut.
mikeday
You need @page { margin-bottom: ... } to be big enough to hold all the text.
MiroMichail
But this text add dynamically, and i don't know what margin-bottom be enough
mikeday
In that case I'm afraid it will be necessary to use a different mechanism than margin boxes, perhaps a page float instead with "float: bottom".
John
If you know the maximum number of lines, you simply can make the bottom margin box high enough to fit the maximum number of lines, which may appear, and then just align the text within the margin box.