Hi. I have the following sample code for constructing a document:
var document = new Document();This code works perfectly fine. It creates a table with three columns, the first column is twice as big as the second and the third. However, if I change the text in the second column to something like this:
var builder = new DocumentBuilder(document);
builder.StartTable();
builder.InsertCell();
builder.CellFormat.PreferredWidth = PreferredWidth.FromPercent(50);
builder.Write(“0”);
builder.InsertCell();
builder.CellFormat.PreferredWidth = PreferredWidth.FromPercent(25);
builder.Write(“1”);
builder.InsertCell();
builder.CellFormat.PreferredWidth = PreferredWidth.FromPercent(25);
builder.Write(“2”);
builder.EndRow();
builder.EndTable();
builder.Write(“1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111”);the result table will be completely ruined (see screenshot in attachments). I’ve found the way to make the table readable by setting Table.AllowAutoFit to false, but this suppresses all PreferredWidth settings.
Is there any way to display such table properly and preserve all PreferredWidth setting?
I am using Aspose Words for .NET 14.4.0.0.