Get Started
Documentation

SetBorders

SetBorders(sBordersIndex, sLineStyle, oColor)

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

Parameters:

Name Type Description
sBordersIndex BordersIndex | string Specifies the cell border position.
sLineStyle LineStyle | string Specifies the line style used to form the cell border.
oColor ApiColor The color object previously created to set the color to the cell border.

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