javascript - 从 HTML 转换为 pdf 时如何将页码添加到固定页脚(通过使用 css 或 js)?
问题描述
我创建了 html,它在转换为 pdf 后有 6 页。我有固定的页脚,想在那里添加页码。我已经尝试了我找到的所有代码 @page{@bottom: content :counter(page)} 并且它不起作用我也尝试编写 js 代码但它也不起作用。
footer{
position:fixed;
z-index:1;
bottom:0;
font-size:11px;
background-color: white;
color:#A2A2A2;
padding-left: 80px;
padding-right: 60px;
width:910px;
box-sizing: border-box}
<footer>
<table id="footer" class="t_f1 pf">
<tbody>
<tr >
<td width="280" align="left">some text</td>
<td width="450" align="right">some text</td>
</tr>
<tr>
<td class="section" align="left">some text</td>
<td align="right">Page number </td>
</tr>
</tbody>
</table>
</footer>
您知道如何在此页脚中添加页码吗?感谢您的任何回复
解决方案
推荐阅读
- javascript - React - 从子组件发布时无法让 DOM 提取最新数据
- unity3d - 在 Unity、VScode 中打开脚本时无法引用 .NetFramework
- python - 我无法使用 pip 安装 streamlit
- c# - C# 列表元组编码练习
- regex - 如果文件中的项目顺序发生更改,则正则表达式不匹配
- angular - 将 Angular 7 升级到 10 后,Angular DOM 操作中断
- android - 设置 firebase - Unity 项目 - com.google.firebase.MessagingUnityPlayerActivity & MessageForwardingService 未找到
- html - 将 Jekyll 标签分为两组
- azure-functions - 无法运行 Azure 功能。错误 - 值不能为空。(参数“提供者”)。- Java、Spring Cloud Function、Azure 函数示例
- javascript - 如何计算 h2 元素之后的输入元素的数量?