在html打印期间,表格页脚应显示在每页的底部

在html打印期间,表格页脚应显示在每页的底部,html,css,Html,Css,我想在打印时显示页眉和页脚。所以我使用的代码是: <table align="center"> <thead style="display: table-header-group;"> <tr> <td> Header </td> </tr> </thead> <tbody

我想在打印时显示页眉和页脚。所以我使用的代码是:

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

标题和内容显示正确。页脚也显示在每一页的末尾是正确的。但问题是,当最后一页内容只有一行时,页脚显示在该行之后,而不是页面底部。

在index.php中重命名index.html。创建一个footer.php。 在footer.php中插入页脚代码

进入index.html并将以下代码添加到要添加页脚的部分:

<?php

include 'footer.php';

?>

可能的复制品你应该看看你能制作一个演示或小提琴吗?