Skip to main content

SetColumnWidth

Sets the width of the specified column (by index) of the current table.

Syntax​

expression.SetColumnWidth(columnIndex, width);

expression - A variable that represents an ApiTable class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
columnIndexRequirednumberThe zero-based column index.
widthRequiredEMUThe column width measured in English measure units.

Returns​

EMU | null

Example​

Set the width of a specific table column in a document.

// Apply a width value measured in English measure units to a single column.

// Create a 3x3 table and widen its first column to 40 millimeters.

let doc = Api.GetDocument();
let table = Api.CreateTable(3, 3);
table.SetWidth("percent", 100);
doc.Push(table);
table.SetColumnWidth(0, Api.MillimetersToEmus(40));