Hi,
I’ve been trying to apply table cell padding to word/pdf documents generated from aspose.words but have been unsuccessful. I’ve tried this bot as a style in the markup and also in the aspose.word engine but its not working.
Below are the two ways that i used in aspose word engine to make the cell padding in tables work. Need help.
Formatting each cell in every table
Node currentNode = documentBuilder.CurrentParagraph;
while (currentNode != null)
{
currentNode = currentNode.NextSibling;
if (currentNode != null && currentNode.NodeType == NodeType.Table)
{
Aspose.Words.Tables.Table table = currentNode as Aspose.Words.Tables.Table;
if (table != null)
{
foreach(Aspose.Words.Tables.Row row in table.Rows)
{
foreach(Aspose.Words.Tables.Cell cell in row.Cells)
{
cell.CellFormat.LeftPadding = 10;
cell.CellFormat.RightPadding = 10;
}
}
}
}
}
Format cell style using DocumentBuilde
DocumentBuilder documentBuilder = new DocumentBuilder(doc);
documentBuilder.CellFormat.LeftPadding = 10;
documentBuilder.CellFormat.RightPadding = 10;
where doc is an Aspose.Words.Document instance.