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

Free Support Forum - aspose.com

UL bottom margin with InsertHtml

Hi,

I cannot seem to figure out how to control the bottom margin of UL when html is inserted with builder.InsertHtml().

For example, when I use the following line, there will be a margin between BBB and CCC. How can I control the margin height?

builder.InsertHtml("
  • AAA
  • BBB
  • CCC
  • DDD
    • ");

Thanks.

Hi

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

Thanks for your inquiry. As I can see, Aspose.Words inserted these two lists properly, exactly as IE displays them. If you would like to remove this spacing between lists, you can try resetting “Spacing After” of paragraphs, which are list items. Please let me know if you need more assistance, I will be glad to help you.

Best regards.

Hi Alexey,


Thanks for the directions. I’ve got it working with the following code.

builder.InsertHtml(“
  • AAA
  • BBB
  • CCC
  • DDD
    • ”);

NodeCollection paragraphs = doc.GetChildNodes(NodeType.Paragraph, true);
foreach (Paragraph paragraph in paragraphs)
{
if (paragraph.IsListItem)
{
paragraph.ParagraphFormat.SpaceAfterAuto = false;
paragraph.ParagraphFormat.SpaceAfter = 0;
}
}

Thanks.

Hi

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

It is perfect that you found a workaround of the problem.

Best regards.