html分页打印 每页都有表头、表尾

发布时间:2019年12月13日      浏览次数:444 次
<!DOCTYPE html>
<html>
<head>
      <meta charset="utf-8" />
</head>
<body>
<table width="100%" cellpadding="4" cellspacing="0" bordercolordark="#FFFFFF" style="border-collapse:collapse; border-top:1px #666 solid; border-left:1px #666 solid;">
      <thead style="display:table-header-group">
            <tr style="page-break-inside: avoid;">
                  <td style=" border-right:1px #666 solid; border-bottom:1px #666 solid;">
                        <div align="center">打印时每页都有表头!</div>
                  </td>
            </tr>
      </thead>
      <tbody>
            <tr style="page-break-inside: avoid;">
                  <td height="300" style=" border-right:1px #666 solid; border-bottom:1px #666 solid;">
                        <div align="center">
                              表内容1
                        </div>
                  </td>
            </tr>
            <tr style="page-break-inside: avoid;">
                  <td height="300" style=" border-right:1px #666 solid; border-bottom:1px #666 solid;">
                        <div align="center">
                              表内容2
                        </div>
                  </td>
            </tr>
            <tr style="page-break-inside: avoid;">
                  <td height="300" style=" border-right:1px #666 solid; border-bottom:1px #666 solid;">
                        <div align="center">
                              表内容3
                        </div>
                  </td>
            </tr>
            <tr style="page-break-inside: avoid;">
                  <td height="300" style=" border-right:1px #666 solid; border-bottom:1px #666 solid;">
                        <div align="center">
                              表内容4
                        </div>
                  </td>
            </tr>
            <tr style="page-break-inside: avoid;">
                  <td height="300" style=" border-right:1px #666 solid; border-bottom:1px #666 solid;">
                        <div align="center">
                              表内容5
                        </div>
                  </td>
            </tr>
            <tr style="page-break-inside: avoid;">
                  <td height="300" style=" border-right:1px #666 solid; border-bottom:1px #666 solid;">
                        <div align="center">
                              表内容6
                        </div>
                  </td>
            </tr>
      </tbody>
      <tfoot style="display:table-footer-group;">
            <tr>
                  <td style=" border-right:1px #666 solid; border-bottom:1px #666 solid;">
                        <div align="center">打印时每页都有表尾!</div>
                  </td>
            </tr>
      </tfoot>
</table>
</body>
</html>
免责声明:本站相关技术文章信息部分来自网络,目的主要是传播更多信息,如果您认为本站的某些信息侵犯了您的版权,请与我们联系,我们会即时妥善的处理,谢谢合作!