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

Free Support Forum - aspose.com

Nested HTML table widths are not working correctly

When converting HTML, a nested table with a width of 100% should be the full width of its container, however, the PDF Generator is setting the width too wide, possibly the full width of the page.


Is there another way to convert HTML to PDF to get around this problem?

I am not very familiar with Aspose. I am evaluating this product. This problem could be a show stopper.

















1A1 1B1
1A2 1B2
1A3 1B3








2A1 2B1
2A2 2B2









3A1 3B1
3A2 3B2



Hi Andrew,


Thanks for contacting support.

I have tested the scenario using new Document Object Model of Aspose.Pdf for .NET and I am unable to notice any problem. For your reference, I have attached the PDF document generated over my end. Can you please try using the new Document Object Model approach and in case you still face the same issue or you have any further query, please feel free to contact.

[C#]

//
instantiate Document instance
<o:p></o:p>

Document document = new Document();

// add page to pages collection of PDF file

document.Pages.Add();

// creat an HTML fragment holding HTML contents

HtmlFragment fragment = new HtmlFragment("

1A2 1A3
1A1 1B1
1B2
1B3
2A2
2A1 2B1
2B2
3A1 3B1
3A2 3B2
");

// add HtmlFragment to paragraphs collection of first page

document.Pages[1].Paragraphs.Add(fragment);

// save PDF file

document.Save("c:/pdftest/TableFormattingIssue.pdf");