Search code examples
mpdf

MPDF - Position absolute and bottom 0


I would like to fix a table in the footer, but it is when generating the PDF.

Using in the browser works, but not when the pdf is generated.

<table width="100%" style="position:absolute; bottom:0">
    <thead>
    <tr>
        <th width="33%" style="border-top: 1px solid #000">Assinatura</th>
        <th width="33%"></th>
        <th width="33%"></th>
    </tr>
    </thead>
</table>


Solution

  • Wrap the table in a DIV tag and absolute position the DIV.

    <div style="position:absolute; bottom:0">
    
        <table width="100%">
            <thead>
            <tr>
                <th width="33%" style="border-top: 1px solid #000">Assinatura</th>
                <th width="33%"></th>
                <th width="33%"></th>
            </tr>
            </thead>
        </table>
    
    </div>