Free Support Forum - aspose.com

How to change the width of nested table

Aspose.Pdf.Generator.Row row14 = tab1.Rows.Add();
row14.DefaultCellTextInfo.FontSize = 7;
row14.Cells.Add("");
row14.Cells.Add(“Details:”);
row14.Cells.Add("");
row14.Cells.Add("");
Aspose.Pdf.Generator.Cell cell14 = row14.Cells[3];
cell14.FitWidth = 20;
cell14.ColumnsSpan = 5;
Aspose.Pdf.Generator.Table tab2 = new Aspose.Pdf.Generator.Table(cell14);
//Add the nested table into the paragraphs collection of the 2nd cell

cell14.Paragraphs.Add(tab2);
//Set the column widths of the nested table

tab2.ColumnWidths = “10”;
tab2.FixedWidth = 50;
tab2.DefaultCellBorder = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 1F);
//Set table border using another customized BorderInfo object
tab2.Border = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 1.5F);
tab2.Alignment = Aspose.Pdf.Generator.AlignmentType.Justify;

//Create MarginInfo object and set its left, bottom, right and top margins

//Set the default cell padding to the MarginInfo object
tab2.DefaultCellPadding = margin;

//Create rows in the table and then cells in the rows
Aspose.Pdf.Generator.Row row77 = tab1.Rows.Add();
row77.FixedRowHeight = 100;

row77.Cells.Add("");
//Aspose.Pdf.Generator.Cell cell14 = row14.Cells.Add(“top cell”);

row14.Cells.Add("");
row14.Cells.Add("");
row14.Cells.Add("");
row14.Cells.Add("");
row14.Cells.Add("");
row14.Cells.Add("");


need to change the width nested table. I used but width is not changed…


Need help…

Hi Arunava,

Thanks for using our products.

The width of table depends upon the number of columns and width of specific columns inside a table. As Table.
ColumnWidths property is used to specify the width of columns, it will affect the width of resultant table. Can you please share “how you would like the resultant table to be displayed ?/what value you need to specify against table width ?” If possible, please share the complete code snippet.

We apologize for your inconvenience.