Get Started
Usage API

SetColumnWidth

SetColumnWidth(nWidth)

Sets the width of all columns in the specified range. One unit of column width is equal to the width of one character in the Normal style. For proportional fonts, the width of the character 0 (zero) is used.

Parameters:

Name Type Description
nWidth number

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("xlsx");
oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A1").SetColumnWidth(20);
builder.SaveFile("xlsx", "SetColumnWidth.xlsx");
builder.CloseFile();

Resulting document