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
Description

Excerpt

Sets an int representing the width of a particular column. In order to set the width of a column, you must first set the PreferredColumnWidthUnit of that column.

Signature
C#
C#
 public void SetPreferredColumnWidth(int column, int width)
Signature
vb.net
vb.net
Public Sub SetPreferredColumnWidth(ByVal column As Integer, ByVal width As Integer)
Parameters
Param
column
column

An int representing the index of the column for which to change the width.

Param
width
width

An int representing the column's new width in twips. One twip = (1/20 pt) or (1/1440 in).

Remarks

MS Word equivalent: Table menu > Table properties... > Column tab > Size section > Column #: > Preferred width:

Example
Code Block
csharp
csharp
titleC#

          //--- Set the width of the 3rd column to 1 inch
          oTable.SetPreferredColumnWidthUnits(2, TableCell.WidthUnits.Twips);
          oTable.SetPreferredColumnWidth(2, 1440);
        
Code Block
vb.net
vb.net
titlevb.net

          '--- Set the width of the 3rd column to 1 inch
          oTable.SetPreferredColumnWidthUnits(2, TableCell.WidthUnits.Twips)
          oTable.SetPreferredColumnWidth(2, 1440)