首页 > 解决方案 > MPDF - 绝对位置和底部 0

问题描述

我想在页脚中修复一个表格,但它是在生成 PDF 时。

在浏览器中使用有效,但在生成 pdf 时无效。

<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>

标签: mpdf

解决方案


将表格包装在 DIV 标记中并绝对定位 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>

推荐阅读