textAlign

Gets or sets the text alignment of the cells in the range.

Parameters

value String optional

One of the following values: "left", "center", "right" and "justify".

Returns

String the current text alignment of the top-left cell of the range.

Example

    <div id="spreadsheet"></div>
    <script type="text/javascript" charset="utf-8">
        $("#spreadsheet").kendoSpreadsheet();
        var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
        var sheet = spreadsheet.activeSheet();
        sheet.range("A1").value("left");
        sheet.range("A1").textAlign("left");
        sheet.range("A2").value("right");
        sheet.range("A2").textAlign("right");
        sheet.range("A3").value("center");
        sheet.range("A3").textAlign("center");
        sheet.range("A4").value("justify");
        sheet.range("A4").textAlign("justify");
    </script>

In this article