SpreadJS 13
GC.Spread.Sheets Namespace / CellRange type / hAlign Method
The horizontal alignment.
In This Topic
    hAlign Method
    In This Topic
    Gets or sets the horizontal alignment of the contents of the cell.
    Syntax
    var instance = new GC.Spread.Sheets.CellRange(sheet, row, col, rowCount, colCount, sheetArea);
    var returnValue; // Type: any
    returnValue = instance.hAlign(value);
    function hAlign( 
       (optional) value : HorizontalAlign
    ) : any;

    Parameters

    value
    The horizontal alignment.

    Return Value

    If no value is set, returns the horizontal alignment of the contents of the cell; otherwise, returns the cell.
    Example
    The following examples set the alignment.
    activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).hAlign(GC.Spread.Sheets.HorizontalAlign.left);
    activeSheet.getCell(1,1).hAlign(GC.Spread.Sheets.HorizontalAlign.center);
    activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).hAlign(GC.Spread.Sheets.HorizontalAlign.right);
    Remarks
    The default value is HorizontalAlign.center.
    See Also