2017-04-10 38 views
0

我想在頁面上打印頁眉和頁腳。所以我使用的代碼是:表格頁腳應在每頁的底部顯示在html中打印

<table align="center"> 
    <thead style="display: table-header-group;"> 
     <tr> 
      <td> 
       Header 
      </td> 
     </tr> 
    </thead> 
    <tbody> Body data</tbody> 
    <tfoot style="display: table-footer-group; bottom:0;"> 
    </tfoot> 
</table> 

標題和內容顯示正確。頁腳也顯示在每頁末尾是正確的。但問題是當最後一頁內容只有一行,頁腳顯示在該行後面而不是頁面底部時。

+0

[打印表格頁腳的可能的複製的在最後一頁的底部](http://stackoverflow.com/questions/33448846/print-table-footer-at-the-very-bottom-on-last-page) – xhg

+0

你應該看看[DoctorDestructo的答案](http://stackoverflow.com/a/33642115/2361752) – xhg

+0

你可以創建一個演示或小提琴? – nashcheez

回答

0

在index.php中重命名您的index.html。創建一個footer.php。 插入您的頁腳代碼在footer.php

進入您的index.html和下面的代碼添加到您要添加您的頁腳部分:

<?php 

include 'footer.php'; 

?>