【发布时间】:2016-07-24 19:16:38
【问题描述】:
我在这里看到了其他类似的问题,但我无法解决我的问题。 我的问题是:页眉在所有页面中都正常工作,但页脚只显示在最后一页。
<?
$mpdf = new mPDF( '', // mode - default ''
'', // format - A4, for example, default ''
0, // font size - default 0
'', // default font family
15, // margin_left
15, // margin right
58, // margin top
60, // margin bottom
6, // margin header
0, // margin footer
'L' ); // L - landscape, P - portrait
$mpdf->SetDisplayMode('fullpage');
$cabecalho = '<div>header</div>';
$paragrafo = '<div>body</div>';
$stylesheet = "table{
width: 100%;
text-align:center;
border: 2px solid black;
}
";
$footer = "<table name='footer' width=\"1000\">
<tr>
<td style='font-size: 18px; padding-bottom: 20px;' align=\"right\">{PAGENO}</td>
</tr>
</table>";
$mpdf->SetHTMLHeader($cabecalho);
$mpdf->WriteHTML($stylesheet, 1);
$mpdf->WriteHTML($paragrafo);
$mpdf->SetFooter($footer);
$mpdf->Output();
exit;
?>
这里的页脚有什么问题?
【问题讨论】:
-
试试这个
SetHTMLFooter()而不是SetFooter() -
@severinolorillajr 我也试过了,同样的问题
-
我编辑了问题,并把我的代码开始
-
你最近检查过文档吗?