addStyle of ui.spreadsheet, Methods Webix Docs
Example
// adding a style
var styleProps = $$("ssheet").addStyle({
"background":"#6E6EFF",
"color": "#FFFFFF",
}, null, "Sheet1");
// setting the created style for a cell
$$("ssheet").setStyle(3,2,styleProps);
// redrawing SpreadSheet
$$("ssheet").refresh();
Details
You can use a previously created style as a base and complete it with some new style properties to make a new style:
// creating a new style on the base of the previous one
var newStyle = $$("ssheet").addStyle({
"font-style": "italic"
}, baseStyle);
// applying the new style to a cell
$$("ssheet").setStyle(3,2, newStyle);
// redrawing SpreadSheet
$$("ssheet").refresh();
Note that the style options are limited:
"background", "borders", "border-bottom", "border-left", "border-right", "border-top", "color", "font-family", "font-size", "font-style", "font-weight", "format", "indent", "strike", "text-align", "underline", "vertical-align", "wrap".
Pay attention that for cell borders you can specify only the border-color property, while the border-width and border-style properties have predefined values: 1px and solid, correspondingly.
See also
Back to topIf you have not checked yet, be sure to visit site of our main product Webix mvc library and page of web spreadsheet product.