getStyle

returns styles applied to a cell(s)

object|array getStyle(string cells);

Parameters

cellsstringthe id of a cell or a range of cells

Returns

object|arraystyles set for a cell/cells

Example

// getting style of one cell
var style = spreadsheet.getStyle("A1"); 
// -> {background: "#8DE9E1", color: "#03A9F4"}
 
// getting styles of a range of cells
var rangeStyles = spreadsheet.getStyle("A1:D1"); // -> see details
 
// getting styles of different cells
var values = spreadsheet.getStyle("A1,B1,C1:C3");

Details

For multiple cells the method returns an array of objects with styles applied to a cell:

[
    {background: "red", border: "solid 1px yellow", color: "blue"},
    {background: "red", border: "solid 1px yellow", color: "blue"},
    {background: "#C8FAF6", border: "solid 1px yellow", color: "#81C784"},
    {background: "#9575CD", border: "solid 1px yellow", color: "#079D8F"}
]
See also
Back to top