首页 > 解决方案 > 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?

标签: css

解决方案


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>


推荐阅读