Skip to main content
Participant
June 3, 2020
Question

cfhtmltopdf unordered list indent oddity

  • June 3, 2020
  • 1 reply
  • 220 views

Considering the following HTML:

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<ul><li>normal text</li><li style="text-indent: 4em">another text</li><li style="text-indent: 4em">some other text</li></ul>


</body>
</html>

It renders in my browser (and WYSIWYG editor) like this:

But it renders in the PDF produced by both cfdocument and cfhtmltopdf like this:

Any ideas for what I can do to get it to render consistently in the PDF?

 

Thanks in advance,

 

Leighton

 

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    June 3, 2020

    Perhaps it is doing that because text-indent is meant to style text blocks. Try using the margin or padding property instead. For example,

     

    <!DOCTYPE html>
    <html>
    <head>
    <title>Page Title</title>
    </head>
    <body>
    <ul style="margin-left: 1em">
    	<li>normal text</li>
    	<li style="margin-left: 4em">another text</li>
    	<li style="margin-left: 4em">some other text</li>
    </ul>
    </body>
    </html>