css - I want to display footer Template Page Number to Right of Page
问题描述
I am adding some styling to what ultimately ends up being printed as a footer section of a PDF. All I'm trying to do is align the page number display to the right of the page - currently it's displaying on the left:
<table style="margin: 0 30px; position: absolute; float: right">
<tr style="font-size: 10px; color: #333; font-family: 'Helvetica Neue', 'Helvetica'; line-height: normal; width: 500px">
<td style="width: 2px">Page</td>
<td style="width: 2px" class='pageNumber'></td>
<td style="width: 2px">of</td>
<td style="width: 2px" class='totalPages'><td>
</tr>
</table>
I also tried this (with 100% not in quotes):
<table style="margin: 0 30px; position: absolute; float: right; width: 100%;">
And this with it in quotes:
<table style="margin: 0 30px; position: absolute; float: right; width: '100%';">
But none of the above work. The page number display is still on the far left.
What do I need to adjust to get this to float to the far right of the page?
解决方案
Please try below updated code.
<table style="margin: 0 30px; float: right">
<tr style="font-size: 10px; color: #333; font-family: 'Helvetica Neue', 'Helvetica'; line-height: normal; width: 500px">
<td style="width: 2px">Page</td>
<td style="width: 2px" class='pageNumber'></td>
<td style="width: 2px">of</td>
<td style="width: 2px" class='totalPages'><td>
</tr>
</table>
推荐阅读
- android - Android YUV_420_888 to RGBA with ScriptIntrinsicYuvToRGB NV21 and nio buffers in JNI
- javascript - 如何使用 Javascript 或 ExtJs 删除 HTML 块中没有属性的 span 标签
- php - 在 PHP 中通过 foreach 和 mysql 创建分组行
- javascript - 我已经安装了 opusscript / @discordjs/opus 似乎找不到 Opus 引擎
- regex - 正则表达式匹配行,其中第一个单词在该行的其他地方重复
- c# - 如何让visual studio高亮关键词
- cuda - ptxas 抱怨(输入)我悲伤的设备功能
- python - 叶图返回“TypeError:int64 类型的对象不是 JSON 可序列化的”
- android - 在 Android Studio 中打开对话框时,如何让我的活动保持运行?
- ruby-on-rails - 为什么 User.count 返回 0,直到 bin/spring 在 Ruby on Rails 中重新启动?