DynaPDF.Table.SetTableWidth
---------------------------

Changes the width of the table.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [3.5](newinversion35.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.Table.SetTableWidth"; Table; Value; AdjustType; MinColWidth ) 

**MBS**( **"DynaPDF.Table.SetTableWidth";** /\* Changes the width of the table. \*/  
**$Table**; /\* The identifier for the table. \*/   
**$Value**; /\* The new value for the table width.e.g. 500 \*/   
**$AdjustType**; /\* The adjustment type. Can be UniqueWidth, AdjLeft or AdjRight.e.g. "AdjLeft" \*/   
**$MinColWidth**) /\* The optional minimum column width.e.g. 100 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Table | The identifier for the table. | $Table |
| Value | The new value for the table width. | 500 |
| AdjustType | The adjustment type. Can be UniqueWidth, AdjLeft or AdjRight. | "AdjLeft" |
| MinColWidth | The optional minimum column width. | 100 |

### Result

Returns OK on succes.

### Description

Changes the width of the table.  
At least one column must be modified when the width will be changed. The parameter AdjustType specifies how the column widths should be modified. If the new width is larger, then the difference can be added to the left or right column, or all columns can get a unique width (TableWidth / NumColumns). The parameter MinColWidth is ignored in this case.  
If the new width is smaller, then the difference must be subtracted from the columns. The parameter MinColWidth specifies in this case the minimum width of columns that must be adjusted. It is only used if AdjustType is not set to coaUniqueWidth. The column widths are adjusted starting from the left or right side as specified. If the width of the first column is not large enough to subtract the entire difference, then the minimum width is set to the column and the adjustment continues with the next column until the gap is zero.  
If the new table width is smaller as MinColWidth \* NumColumns then the widths of the remaining columns will be set to zero. Such cases should be avoided since the column widths must be adjusted again when the table is drawn.  
### See also

- [DynaPDF.Table.AddColumn](DynaPDFTableAddColumn.md)
- [DynaPDF.Table.GetTableHeight](DynaPDFTableGetTableHeight.md)
- [DynaPDF.Table.GetTableWidth](DynaPDFTableGetTableWidth.md)
- [DynaPDF.Table.SetBorderWidth](DynaPDFTableSetBorderWidth.md)
- [DynaPDF.Table.SetColWidth](DynaPDFTableSetColWidth.md)
- [DynaPDF.Table.SetGridWidth](DynaPDFTableSetGridWidth.md)
- [DynaPDF.Table.SetRowHeight](DynaPDFTableSetRowHeight.md)

This function checks for a license.

Created 18th August 2014 , last changed 18th August 2014

  
[DynaPDF.Table.SetRowHeight](DynaPDFTableSetRowHeight.md) - [DynaPDF.TestGlyphs](DynaPDFTestGlyphs.md)

[HTML Version](DynaPDFTableSetTableWidth.shtml)