Page tree

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
Wiki Markup
{description}
{excerpt}Returns or sets an {{int}} that represents the preferred width of this cell. In order to set this property, the [CellWidthUnits|TableCell.CellWidthUnits] property must first be set. The width is returned in twips. One twip = \(1/20 pt\) or \(1/1440 in\).{excerpt}
{signature:C#}
 public int PreferredWidth{ get; set; }
{signature}{signature:vb.net}
Public Property PreferredWidth() As Integer
{signature}
{remarks}MS Word equivalent: Table menu > Table Properties... > Cell tab > Size section > Preferred width:

{remarks}
{example}{code:csharp|title=C#}

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

          //--- Set PreferredWidth to 1 inch
          cell.CellWidthUnits = TableCell.WidthUnits.Twips;
          cell.PreferredWidth = 1440;
        {code}
{code:vb.net|title=vb.net}

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

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

{example}