Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
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#
Wiki Markup
{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|Table.SetPreferredColumnWidthUnits(Int32, TableCell.WidthUnits)] of that column.{excerpt}
{signature:C#}
 public void SetPreferredColumnWidth(int column, int width)
Signature
{signature}{signature:vb.net
vb.net
}
Public Sub SetPreferredColumnWidth(ByVal column As Integer, ByVal width As Integer)
Parameters

...

An int representing the index of the column for which to change the 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:

{signature}
{parameters}
{param:column}An {{int}} representing the index of the column for which to change the width.{param}
{param:width}An {{int}} representing the column's new width in twips. One twip = \(1/20 pt\) or \(1/1440 in\).{param}
{remarks}MS Word equivalent: Table menu > Table properties... > Column tab > Size section > Column \#: > Preferred width:

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

          //--- Set the width of the 3rd column to 1 inch
          oTable.SetPreferredColumnWidthUnits(2, TableCell.WidthUnits.Twips);
          oTable.SetPreferredColumnWidth(2, 1440);
        
{code}
{code:vb.net
|title=vb.net
}

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

{example}
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle