SetBorders

function SetBorders(bordersIndex: BordersIndex = null, lineStyle: LineStyle = null, oColor: ApiColor = null): void

Description

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

Parameters

bordersIndexBordersIndexdefault: null

Specifies the cell border position.

lineStyleLineStyledefault: null

Specifies the line style used to form the cell border.

oColorApiColordefault: null

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

Returns

void

Try It

var oWorksheet = Api.GetActiveSheet();
oWorksheet.SetColumnWidth(0, 50);
oWorksheet.GetRange("A2").SetBorders("Bottom", "Thick", Api.CreateColorFromRGB(255, 111, 61));
oWorksheet.GetRange("A2").SetValue("This is a cell with a bottom border");

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).