Styling in footer of chrome-pdf



  • Hi,
    I am stuck at such a little thing. I am trying to align footer text in center and am using style="text-align:center" but it still puts at left corner.

    Any help is appreciated,
    thank you,
    Rashmi

    <style>
        footer {
       position:absolute;
       bottom:10px;
       height:25px;
       width:98%;
    }
    .makeCenter {
        text-align:center
    }
    </style>
    <footer>
        {{#if_gt $pdf.pages.length 1}}
            <span style="padding-left:65px"> {{$pdf.pageNumber}}/{{$pdf.pages.length}}</span>
        {{/if_gt}} 
      {{#with (lookup $pdf.pages $pdf.pageIndex)}}
         <span class="makeCenter"> {{group.name}}{{group.more}} </span>
      {{/with}}
    </footer>
    
    


  • Could you simplify (as much as you can) and replicate this in playground?

    https://playground.jsreport.net/



  • I found Jan that <span> with style or class for text-align doesn't work but if I change to <div align="center"> or table td align="center" then it aligns.
    In short, text-align bad, align good.

    Thank you.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.