Get Started
Usage API
More information

SetAlignVertical

SetAlignVertical(sAligment) → { bool }

Set the vertical alignment of the text in the current cell range.

Parameters:

Name Type Description
sAligment 'center' | 'bottom' | 'top' | 'distributed' | 'justify'

The parameters will define the vertical alignment that will be applied to the cell contents.

Returns:

Type
bool

Example

Copy code
builder.CreateFile("xlsx");
oWorksheet = Api.GetActiveSheet();
sRange = oWorksheet.GetRange("A1:D5");
oWorksheet.GetRange("A2").SetValue("2");
sRange.SetAlignVertical("top");
builder.SaveFile("xlsx", "SetAlignVertical.xlsx");
builder.CloseFile();

Resulting document