Introduced in build 4.1.0.1331
Description
Sets the preferred width of the table and the units for said width.
C#
public void SetPreferredWidth(double width, Units units)
vb.net
Public Sub SetPreferredWidth(ByVal width As Double, ByVal units As Units)
Parameters
width
The preferred width of the table.MS Word equivalent: Table menu > Table Properties... > Table tab > Options... > dropdown after "Preferred width"
units
The units for the width.For Units.Auto:
MS Word equivalent: Table menu > Table Properties... > Table tab > Options... > Preferred width
For Units.Percent, or Units.Twips:
MS Word equivalent: Table menu > Table Properties... > Table tab > Options... > Measure in
Exceptions
ArgumentOutOfRangeException
If units is something other than Units.Auto,Units.Percent, or Units.Twips.Remarks
$bodyExamples
C#
// 50% table.SetPreferredWidth(50, Units.Percent); // or 2" table.SetPreferredWidth(2880, Units.Twips); // or auto fit table.SetPreferredWidth(0,Units.Auto);
vb.net
' 50% table.SetPreferredWidth(50, Units.Percent) ' or 2" table.SetPreferredWidth(2880, Units.Twips) ' or auto fit table.SetPreferredWidth(0, Units.Auto)
