PreferredWidthType Enumeration

Specifies the unit of measurement for the preferred width of a table or cell.

Namespace:  Aspose.Words.Tables
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 21.11.0


public enum PreferredWidthType


  Member nameValueDescription
Auto1 The preferred width is not specified. The actual width of the table or cell is either specified using the explicit width or will be determined automatically by the table layout algorithm when the table is displayed, depending on the table auto fit setting.
Percent2 Measure the current item width using a specified percentage.
Points3 Measure the current item width using a specified number of points (1/72 inch).


Shows how to verify the preferred width type and value of a table cell.
Document doc = new Document(MyDir + "Tables.docx");

Table table = doc.FirstSection.Body.Tables[0];
Cell firstCell = table.FirstRow.FirstCell;

Assert.AreEqual(PreferredWidthType.Percent, firstCell.CellFormat.PreferredWidth.Type);
Assert.AreEqual(11.16d, firstCell.CellFormat.PreferredWidth.Value);

ExpandedSee Also