com.aspose.words

Class PreferredWidthType

  • java.lang.Object
    • com.aspose.words.PreferredWidthType
public class PreferredWidthType 
extends java.lang.Object

Utility class containing constants. Specifies the unit of measurement for the preferred width of a table or cell.

Example:

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

// Find the first table in the document
Table table = (Table) doc.getChild(NodeType.TABLE, 0, true);
Cell firstCell = table.getFirstRow().getFirstCell();

Assert.assertEquals(PreferredWidthType.PERCENT, firstCell.getCellFormat().getPreferredWidth().getType());
Assert.assertEquals(11.16, firstCell.getCellFormat().getPreferredWidth().getValue());
See Also:
PreferredWidth

Field Summary
static final intAUTO = 1
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.
static final intPERCENT = 2
Measure the current item width using a specified percentage.
static final intPOINTS = 3
Measure the current item width using a specified number of points (1/72 inch).
 

    • Field Detail

      • AUTO = 1

        public static final int AUTO
        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.
      • PERCENT = 2

        public static final int PERCENT
        Measure the current item width using a specified percentage.
      • POINTS = 3

        public static final int POINTS
        Measure the current item width using a specified number of points (1/72 inch).