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

Free Support Forum - aspose.com

Modifying cell padding in a table changes the cell width

Hello,

I have ran into the following issue. When modifying the left and right padding past a certain value, the resulting cells have a different width than before.

Here is the code used to reproduce this issue, along with the attached file:
----------------------------
var document = new Document(“testFile.docx”);

var values = new[] {0, 14.4, 21.599999, 28.8, 36, 43.1999, 50.4};
var index = 0;

foreach (Section section in document.Sections)
{
foreach (Table table in section.Body.Tables)
{
foreach (Row row in table.Rows)
{
foreach (Cell wordsCell in row.Cells)
{
wordsCell.CellFormat.LeftPadding = values[index];
wordsCell.CellFormat.RightPadding = values[index];
}
}

++index;
}
}

document.Save(“out.docx”);
----------------------------

InternalId: 27582

Best regards,
Jean-Alexandru Stanescu
Junior Developer
IBM Romania

Hi Jean-Alexandru,

Thanks for your inquiry.

Please note that Aspose.Words mimics the same behavior as MS Word does. If you set the cell margins using MS Word, you will get the same output.

Hello,

I verified and indeed it mimics MS Word’s behavior.

Thank you for the help!

Hi Jean-Alexandru,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.