页眉页脚
当我们想打印当前页面或者保存当前页面为PDF的时候,希望加上自己自定义的logo或者文字,经过调研,找到如下两种最常用的添加页眉页脚方式,但是却不是最理想的实现方案,依然在努力调研中
table实现方式
利用标签 和(当长的表格被打印时,表格的和可被打印在包含表格数据的每张页面上。)这个特性,来自定义页面与页脚
<style>
.preview-table {
table-layout: fixed;
width: 100%;
border: none;
margin: 0px;
padding: 0px;
}
.page-footer {
position: fixed;
bottom: 0;
width: 100%;
border-top: 1px solid black;
text-align: center;
}
.page-header {
position: fixed;
top: 0mm;
width: 100%;
border-bottom: 1px solid black;
text-align: center;
}
.header-content,
.footer-content {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.page-header,
.page-header-space {
height: 70