SpreadJS Documentation > Sample Code > Sample Code for Cells > Setting the Cell Color |
You can set the backcolor and forecolor for the cells.
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"); }); |