Skip to main content

GetColumnWidth

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

Syntax​

expression.GetColumnWidth(columnIndex);

expression - A variable that represents an ApiTable class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
columnIndexRequirednumberThe zero-based column index.

Returns​

EMU | null

Example​

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

// Read a column width value measured in English measure units.

// Create a table, set the first column width and read it back.

let doc = Api.GetDocument();
let table = Api.CreateTable(3, 3);
table.SetWidth("percent", 100);
doc.Push(table);
table.SetColumnWidth(0, Api.MillimetersToEmus(40));
let columnWidth = table.GetColumnWidth(0);
let paragraph = doc.GetElement(0);
paragraph.AddText("Column width: " + columnWidth);