Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Description

Excerpt

Returns or sets an int that represents the preferred width of this cell. In order to set this property, the CellWidthUnits property must first be set. The width is returned in twips. One twip = (1/20 pt) or (1/1440 in).

Signature
C#
C#
 public int PreferredWidth{ get; set; }
Signature
vb.net
vb.net
Public Property PreferredWidth() As Integer
Remarks

MS Word equivalent: Table menu > Table Properties... > Cell tab > Size section > Preferred width:

Example
Code Block
csharp
csharp
titleC#

          //--- Return PreferredWidth
          int preferredWidth = cell.PreferredWidth;

          //--- Set PreferredWidth to 1 inch
          cell.CellWidthUnits = TableCell.WidthUnits.Twips;
          cell.PreferredWidth = 1440;
        
Code Block
vb.net
vb.net
titlevb.net

          '--- Return PreferredWidth
          Dim preferredWidth As Integer = cell.PreferredWidth

          '--- Set PreferredWidth to 1 inch
          cell.CellWidthUnits = TableCell.WidthUnits.Twips
          cell.PreferredWidth = 1440