Get Started
Usage API
More information

SetBorders

SetBorders(bordersIndex, lineStyle, oColor)

Sets the border to the cell / cell range with the parameters specified.

Parameters:

Name Type Description
bordersIndex BordersIndex

Specifies the cell border position.

lineStyle LineStyle

Specifies the line style used to form the cell border.

oColor ApiColor

The color object which specifies the color to be set to the cell border.

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
oWorksheet.SetColumnWidth(0, 50);
oWorksheet.GetRange("A2").SetBorders("Bottom", "Thick", Api.CreateColorFromRGB(49, 133, 154));
oWorksheet.GetRange("A2").SetValue("This is a cell with a bottom border");
builder.SaveFile("xlsx", "SetBorders.xlsx");
builder.CloseFile();

Resulting document