SpreadJS Documentation
Setting the Cell Color

You can set the backcolor and forecolor for the cells.

Using Code

This example sets the backcolor and forecolor for a cell.

JavaScript
Copy Code
$(document).ready(function () {
    var spread = new GcSpread.Sheets.Spread($("#ss").get(0),{sheetCount:3});
    var activeSheet = spread.getActiveSheet();

    //Set the backcolor and forecolor of a cell.
    var cell = activeSheet.getCell(1, 1, GcSpread.Sheets.SheetArea.viewport);
    cell.backColor("Blue");
    cell.foreColor("Red");
    cell.value("Color");
});
See Also

Developer's Guide

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.