SpreadJS 13
GC.Spread.Sheets Namespace / CellRange type / setBorder Method
The border line.

For example, {all:true}, {left:true, right:true}. The following settings are available:

option.all boolean type Specifies all directions for the border.
option.left boolean type Specifies the left border.
option.top boolean type Specifies the top border.
option.right boolean type Specifies the right border.
option.bottom boolean type Specifies the bottom border.
option.outline boolean type Specifies the left, top, right, and bottom borders.
option.inside boolean type Specifies the inner horizontal and vertical borders.
option.innerHorizontal boolean type Specifies the horizontal border.
option.innerVertical boolean type Specifies the vertical border.
all border.
left border.
top border.
right border.
bottom border.
outline border.
inside border.
innerHorizontal border.
innerVertical border.
diagonalUp border.
diagonalDown border.
In This Topic
    setBorder Method
    In This Topic
    Sets the border for the specified area.
    Syntax
    var instance = new GC.Spread.Sheets.CellRange(sheet, row, col, rowCount, colCount, sheetArea);
    var value; // Type: any
    value = instance.setBorder(border,
                               option,
                               options.all,
                               options.left,
                               options.top,
                               options.right,
                               options.bottom,
                               options.outline,
                               options.inside,
                               options.innerHorizontal,
                               options.innerVertical,
                               options.diagonalUp,
                               options.diagonalDown);
    function setBorder( 
       border : LineBorder,
       option : Object,
       (optional) options.all : boolean,
       (optional) options.left : boolean,
       (optional) options.top : boolean,
       (optional) options.right : boolean,
       (optional) options.bottom : boolean,
       (optional) options.outline : boolean,
       (optional) options.inside : boolean,
       (optional) options.innerHorizontal : boolean,
       (optional) options.innerVertical : boolean,
       (optional) options.diagonalUp : boolean,
       (optional) options.diagonalDown : boolean
    ) : any;

    Parameters

    border
    The border line.
    option

    For example, {all:true}, {left:true, right:true}. The following settings are available:

    option.all boolean type Specifies all directions for the border.
    option.left boolean type Specifies the left border.
    option.top boolean type Specifies the top border.
    option.right boolean type Specifies the right border.
    option.bottom boolean type Specifies the bottom border.
    option.outline boolean type Specifies the left, top, right, and bottom borders.
    option.inside boolean type Specifies the inner horizontal and vertical borders.
    option.innerHorizontal boolean type Specifies the horizontal border.
    option.innerVertical boolean type Specifies the vertical border.
    options.all
    all border.
    options.left
    left border.
    options.top
    top border.
    options.right
    right border.
    options.bottom
    bottom border.
    options.outline
    outline border.
    options.inside
    inside border.
    options.innerHorizontal
    innerHorizontal border.
    options.innerVertical
    innerVertical border.
    options.diagonalUp
    diagonalUp border.
    options.diagonalDown
    diagonalDown border.
    Example
    This example creates borders.
    sheet.getCell(1, 1).borderTop(new GC.Spread.Sheets.LineBorder("#F0F8FF",GC.Spread.Sheets.LineStyle.double));
    sheet.getCell(1, 1).borderLeft(new GC.Spread.Sheets.LineBorder("#F0F8FF",GC.Spread.Sheets.LineStyle.hair));
    sheet.getCell(1, 1).borderRight(new GC.Spread.Sheets.LineBorder("#FAEBD7",GC.Spread.Sheets.LineStyle.dashDot));
    sheet.getCell(1, 1).borderBottom(new GC.Spread.Sheets.LineBorder("#00FFFF",GC.Spread.Sheets.LineStyle.medium));
    sheet.getRange(-1, 5, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderTop(new GC.Spread.Sheets.LineBorder("#F0FFFF",GC.Spread.Sheets.LineStyle.medium));
    sheet.getRange(-1, 5, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderLeft(new GC.Spread.Sheets.LineBorder("#F5F5DC",GC.Spread.Sheets.LineStyle.medium));
    sheet.getRange(-1, 5, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderRight(new GC.Spread.Sheets.LineBorder("#FF02FF", GC.Spread.Sheets.LineStyle.dashDot));
    sheet.getRange(-1, 5, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderBottom (new GC.Spread.Sheets.LineBorder("#FFE4C4",GC.Spread.Sheets.LineStyle.thin));
    sheet.getRange(2, 2, 2, 2, GC.Spread.Sheets.SheetArea.viewport).setBorder(new GC.Spread.Sheets.LineBorder("#8A2BE2",GC.Spread.Sheets.LineStyle.thick), { all:true });
    sheet.getRange(5, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).borderTop( new GC.Spread.Sheets.LineBorder("#A52A2A",GC.Spread.Sheets.LineStyle.mediumDashed));
    sheet.getRange(5, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).borderLeft( new GC.Spread.Sheets.LineBorder("#FF02FF",GC.Spread.Sheets.LineStyle.medium));
    sheet.getRange(5, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).borderRight(new GC.Spread.Sheets.LineBorder("#5F9EA0", GC.Spread.Sheets.LineStyle.dashDot));
    sheet.getRange(5, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).borderBottom (new GC.Spread.Sheets.LineBorder("#6495ED",GC.Spread.Sheets.LineStyle.dotted));
    See Also

    Reference

    CellRange type