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

Free Support Forum - aspose.com

Table data getting wrapped using auto fit

Hi I’m dynamically populating a table and using table.autofit but as the data grows a column of the table gets wrapped. We don’t want the column to be wrapped.

Can you please provide some solution for the same

I’m sharing the output file where you colud see the second column is wrappedDEFECT.zip (23.0 KB)

@akhilsam,

Thanks for your inquiry. The Cell.CellFormat.WrapText property wraps the text of cell when its value is true. Please set its value to false to get the desired output.

Table table = (Table)doc.GetChild(NodeType.Table, 0, true);

foreach (Row row in table.Rows)
{
    row.Cells[1].CellFormat.WrapText = false;
}

Hi Tahir,

I have set WrapText = false but still, it is wrapping the content after it finds “-” character.
Is it due to table autofit property that it tries to adjust the table column width?

Thanks
Akhil Samnotra

@akhilsam,

Thanks for your inquiry.

Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing. We will investigate the issue on our side and provide you more information.