SpreadJS Documentation
GC.Spread.Sheets Namespace / Style class / hAlign Field
In This Topic
    hAlign Field
    In This Topic
    Indicates the horizontal alignment.
    Syntax
    var instance = new GC.Spread.Sheets.Style(backColor,
                                             foreColor,
                                             hAlign,
                                             vAlign,
                                             font,
                                             themeFont,
                                             formatter,
                                             borderLeft,
                                             borderTop,
                                             borderRight,
                                             borderBottom,
                                             diagonalDown,
                                             diagonalUp,
                                             locked,
                                             textIndent,
                                             wordWrap,
                                             shrinkToFit,
                                             backgroundImage,
                                             cellType,
                                             backgroundImageLayout,
                                             tabStop,
                                             textDecoration,
                                             imeMode,
                                             name,
                                             parentName,
                                             watermark,
                                             cellPadding,
                                             labelOptions,
                                             labelOptions.alignment,
                                             labelOptions.visibility,
                                             labelOptions.font,
                                             labelOptions.foreColor,
                                             labelOptions.margin,
                                             isVerticalText,
                                             textOrientation);
    var value; // Type: HorizontalAlign
    value = instance.hAlign;
    var hAlign : HorizontalAlign;
    Example
    This example sets the hAlign property.
    var style = new GC.Spread.Sheets.Style();
    style.font = "8pt Arial";
    style.hAlign = GC.Spread.Sheets.HorizontalAlign.center;
    style.vAlign = GC.Spread.Sheets.VerticalAlign.center;
    activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport);
    activeSheet.getCell(1,1).value("B2");
    See Also

    Reference

    Style class