GcSpread.Sheets Namespace > Style class : Style Constructor |
var instance = new GcSpread.Sheets.Style(backColor, foreColor, hAlign, vAlign, font, themeFont, formatter, borderLeft, borderTop, borderRight, borderBottom, locked, textIndent, wordWrap, shrinkToFit, backgroundImage, cellType, backgroundImageLayout, tabStop, textDecoration, imeMode, name, parentName, watermark);
function Style( backColor : string, foreColor : string, hAlign : HorizontalAlign, vAlign : VerticalAlign, font : string, themeFont : string, formatter : undefined, borderLeft : LineBorder, borderTop : LineBorder, borderRight : LineBorder, borderBottom : LineBorder, locked : boolean, textIndent : number, wordWrap : boolean, shrinkToFit : boolean, backgroundImage : string, cellType : BaseCellType, backgroundImageLayout : ImageLayout, tabStop : boolean, textDecoration : TextDecorationType, imeMode : ImeMode, name : string, parentName : string, watermark : string ) : Style;
activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]); var cell = new GcSpread.Sheets.CellValueRule(); cell.operator = 2; cell.value1 = 5; cell.ranges = [new GcSpread.Sheets.Range(0, 0, 10, 1)]; cell.style = new GcSpread.Sheets.Style(); cell.style.backColor = "red"; cell.style.foreColor = "black"; activeSheet.getConditionalFormats().addRule(cell); var top = new GcSpread.Sheets.Top10Rule(); top.type = 0; top.rank = 3; top.stopIfTrue(true); top.ranges = [new GcSpread.Sheets.Range(0, 0, 10, 1)]; top.style = new GcSpread.Sheets.Style(); top.style.foreColor = "red"; activeSheet.getConditionalFormats().addRule(top);
sheet.setValue(0,0, 1,3); sheet.setValue(1,0, 50,3); sheet.setValue(2,0, 100,3); sheet.setValue(3,0, 2,3); sheet.setValue(4,0, 60,3); sheet.setValue(5,0, 90,3); sheet.setValue(6,0, 3,3); sheet.setValue(7,0, 40,3); sheet.setValue(8,0, 70,3); sheet.setValue(9,0, 5,3); sheet.setValue(10,0, 35,3); var style = new GcSpread.Sheets.Style(); style.backColor = "red"; style.borderLeft =new GcSpread.Sheets.LineBorder("blue"); style.borderTop = new GcSpread.Sheets.LineBorder("blue"); style.borderRight = new GcSpread.Sheets.LineBorder("blue"); style.borderBottom = new GcSpread.Sheets.LineBorder("blue"); sheet.getConditionalFormats().addAverageRule( GcSpread.Sheets.AverageConditionType.Above,style,[new GcSpread.Sheets.Range(0, 0, 10, 3)]);