Menu

HTML table of contents page numbers

Help
2014-04-17
2014-04-23
  • Jonne Mikkanen

    Jonne Mikkanen - 2014-04-17

    Basically, I can't get my page numbers to align properly, the exact same problem as this fellow had: https://sourceforge.net/p/tcpdf/bugs/764/

    Some page numbers get aligned differently, although they are in a table with set cell widths and text-align:left on all of them.

    Maybe I missed something, but I didn't find anything definitive in the documentation either. Is there any way to get left aligned page numbers to display properly? As far as I know, right aligned ones don't work without a monospaced font, which I can't use in this case - does the same go for left aligned as well? The example for HTML TOC only says "If you want to align the page number on the right you have to use a monospaced font like courier, otherwise you can left align using any font type."

    Thanks in advance!

     
  • Nicola Asuni

    Nicola Asuni - 2014-04-21

    If you waant to align page numbers on the right, the only reliable way is to use a fixed font size for the numbers.
    Please check the default examples for more information.

     
  • Jonne Mikkanen

    Jonne Mikkanen - 2014-04-22

    Aligning them on the left has the same problem (on a table with, say, two columns and the latter having the pagenumbers aligned to the left side of the column, the numbers are still unevenly aligned).

    So, without an unicode-font it won't work even with align:left?

     
  • Nicola Asuni

    Nicola Asuni - 2014-04-22

    I suggested to use fixed font size for the rigth alignment, left alignment should work without issues.

     
  • Jonne Mikkanen

    Jonne Mikkanen - 2014-04-23

    Like I said in the original message (and the other guy said in the linked issue), it doesn't. If you use a table with two columns, align the numbers on the second column to the LEFT, you get the same issue. The numbers aren't aligned properly; the result is like the one in the attachment, where some numbers (in this case 9 and 11) are uneven.

     
  • Nicola Asuni

    Nicola Asuni - 2014-04-23

    As suggested, you should use a monospaced font to solve the alignment issues.

     

Log in to post a comment.