DynaPDF.Table.SetColWidth
-------------------------

The function changes the width of a column.

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

MBS( "DynaPDF.Table.SetColWidth"; Table; Col; Width; ExtTable ) 

**MBS**( **"DynaPDF.Table.SetColWidth";** /\* The function changes the width of a column. \*/  
**$Table**; /\* The identifier for the table. \*/   
**$Col**; /\* The column number. Range from 0 to [DynaPDF.Table.GetNumCols](DynaPDFTableGetNumCols.md)-1.e.g. 0 \*/   
**$Width**; /\* The new width.e.g. 100 \*/   
**$ExtTable**) /\* Extend the table or adjust the other columns?e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Table | The identifier for the table. | $Table |
| Col | The column number. Range from 0 to [DynaPDF.Table.GetNumCols](DynaPDFTableGetNumCols.md)-1. | 0 |
| Width | The new width. | 100 |
| ExtTable | Extend the table or adjust the other columns? | 0 |

### Result

Returns OK or error.

### Description

The function changes the width of a column.   
The width of a column can be changed in two different ways. If the parameter ExtTable is set to 1, then the difference of the current and new column width is added to the table width and the widths of all other columns is left unchanged.  
If ExtTable is set to 0, the difference is subtracted from the next columns until the gap is zero. If the width of the column is larger as the table width then the table width is adjusted too. All other columns get a zero width in this case.  
The column widths should be set from lower to higher indexes and no value should be set for the last column.  
No column width should exceed the table width if ExtTable is set to false. Otherwise the widths of all other columns must be changed again. Change first the table width and then the column widths in such a case.  
### Examples

Sets the column width for first column to 200 point:

 MBS ("DynaPDF.Table.SetColWidth"; $table ; 0; 200; 1)  
### See also

- [DynaPDF.Table.AddColumn](DynaPDFTableAddColumn.md)
- [DynaPDF.Table.Create](DynaPDFTableCreate.md)
- [DynaPDF.Table.GetNumCols](DynaPDFTableGetNumCols.md)
- [DynaPDF.Table.SetCellImage](DynaPDFTableSetCellImage.md)
- [DynaPDF.Table.SetCellTable](DynaPDFTableSetCellTable.md)
- [DynaPDF.Table.SetCellText](DynaPDFTableSetCellText.md)
- [DynaPDF.Table.SetColor](DynaPDFTableSetColor.md)
- [DynaPDF.Table.SetFontSize](DynaPDFTableSetFontSize.md)
- [DynaPDF.Table.SetRowHeight](DynaPDFTableSetRowHeight.md)
- [DynaPDF.Table.SetTableWidth](DynaPDFTableSetTableWidth.md)

### Example Databases

- [DynaPDF/Book Creation](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Book%20Creation.shtml#3ScriptAnchor_)
- [DynaPDF/Catalog with tables](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Catalog%20with%20tables.shtml#1ScriptAnchor_)
- [DynaPDF/Invoice/Invoice](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Invoice/Invoice.shtml#3ScriptAnchor_)
- [DynaPDF/Merge PDFs](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Merge%20PDFs.shtml#5ScriptAnchor_)
- [DynaPDF/Report](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Report.shtml#1ScriptAnchor_)

### Blog Entries

- [Merge PDF with table of contents](https://www.mbsplugins.de/archive/2020-02-25/Merge_PDF_with_table_of_conten/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

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

  
[DynaPDF.Table.SetColOrRowSpan](DynaPDFTableSetColOrRowSpan.md) - [DynaPDF.Table.SetColor](DynaPDFTableSetColor.md)

[HTML Version](DynaPDFTableSetColWidth.shtml)