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

...

Introducedin
4.1.0.1331

...

4.1.0.1331
Description

Excerpt

Sets the preferred width of the table and the units for said width.

Signature
C#
C#
public void SetPreferredWidth(double width, Units units)
{signature}
{signature:
}
Signature
vb.net
vb.net
Public Sub SetPreferredWidth(ByVal width As Double, ByVal units As Units)
{signature}

{parameters}
{param:width}
The preferred width of the table.
MS Word equivalent: Table menu > Table 
Parameters
Param
width
width

The preferred width of the table.
MS Word equivalent: Table menu > Table Properties...

>

Table

tab

>

Options...

>

dropdown

after

"Preferred

width"

{param} {param:units} The [units|Units] for the width. For [Units.Auto|Units#Auto]: MS Word equivalent: Table menu > Table

Param
units
units

The units for the width.
For Units.Auto:
MS Word equivalent: Table menu > Table Properties...

>

Table

tab

>

Options...

>

Preferred

width


For

[

Units.Percent

|Units#Percent]

,

or

[

Units.Twips

|Units#Twips]

:


MS

Word

equivalent:

Table

menu

>

Table

Properties...

>

Table

tab

>

Options...

>

Measure

in {param} {exceptions} {exception:ArgumentOutOfRangeException} If [units|#param-units] is something other than [Units.Auto|Units#Auto],[Units.Percent|Units#Percent], or [Units.Twips|Units#Twips]. {exception} {remarks} {remarks} {example} {code:csharp|title=C#}

in

Exceptions
Exception
ArgumentOutOfRangeException
ArgumentOutOfRangeException

If units is something other than Units.Auto,Units.Percent, or Units.Twips.

Remarks

Example
Code Block
csharp
csharp
titleC#

// 50%
table.SetPreferredWidth(50, Units.Percent);
// or 2"
table.SetPreferredWidth(2880, Units.Twips);
// or auto fit
table.SetPreferredWidth(0,Units.Auto);
{code} {code:
Code Block
vb.net
|title=
vb.net
titlevb.net
}

' 50%
table.SetPreferredWidth(50, Units.Percent)
' or 2"
table.SetPreferredWidth(2880, Units.Twips)
' or auto fit
table.SetPreferredWidth(0, Units.Auto)
{code} {example}