Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
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).



{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}
Signature
C#C#
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}{signature:vb.net
vb.net
}
Public Property PreferredWidth() As Integer
Remarks
MS Word
{signature}
{remarks}MS Word equivalent: Table menu > Table Properties... > Cell tab > Size section > Preferred width:
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle