We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to add styling to <ul> with mailMerge insertHtml()?

Hi ,


I’m am currently busy with an implementation of the aspose mailmerge combined with the insert HTML method .

Currently when i insert html i get a blank rule/line between different HTML tags .
As an example i insert the following HTML :

text1

text2

  • list item

  • the output is as followed :

    text1

    text2

    -listitem

    I would like to remove the empty line between text2 and -listitem. I know I can remove the margin-bottom from the

    tag, but how can i manipulate this throw the

      tag? Margin and padding seems to have no effect on the
        tag.

    Kind regards,
    Dennis

    Hi

    <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    Thanks for your inquiry. You can specify margin-bottom on LI element, as shown below:

    <html>

    <body>

    <p style="margin-bottom:0pt">text1</p>

    <p style="margin-bottom:0pt">text2</p>

    <ul>

    <li style="margin-bottom:0pt">list item1</li>

    <li style="margin-bottom:0pt">list item2</li>

    <li style="margin-bottom:0pt">list item3</li>

    </ul>

    </body>

    </html>

    LI element corresponds a paragraph that represents a list item.

    Best regards.

    Hi,


    Thanks voor you answer, however this doesn’t fix my problem.
    I do want a margin bottom under a

    tag, except when the paragraph is being followed by a list. I want to do something like:


    text1

    text2

    • list item1

    • Needed output (whitout styling the

      tag):

      text1

      text2
      list item 1

      Kind regards,
      Dennis

      Hi

      <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

      Thanks for your inquiry. As you may know it is impossible to specify negative value of spacing before in Ms Word. So it is not recommended to specify negative margin-top. I think the following HTML will produce the expected output:

      <html>

      <body>

      <p>text1</p>

      <p style="margin-bottom:0pt">text2</p>

      <ul>

      <li>list item1</li>

      <li>list item2</li>

      <li>list item3</li>

      </ul>

      </body>

      </html>

      Best regards,