Skip to main content Skip to footer

How To Align Cell Text in SpreadJS

SpreadJS provides nine alignment options by combination of two directions horizontal and vertical, allow you to show your data at proper position in the cell. Here is sample code how to show your data in different position in the cell:

sheet.getCells(1,1,1,3).vAlign($.wijmo.wijspread.VerticalAlign.top); sheet.getCells(2,1,2,3).vAlign($.wijmo.wijspread.VerticalAlign.center); sheet.getCells(3,1,3,3).vAlign($.wijmo.wijspread.VerticalAlign.bottom); sheet.getCells(1,1,3,1).hAlign($.wijmo.wijspread.HorizontalAlign.left); sheet.getCells(1,2,3,2).hAlign($.wijmo.wijspread.HorizontalAlign.center); sheet.getCells(1,3,3,3).hAlign($.wijmo.wijspread.HorizontalAlign.right); sheet.getCells(1,1,3,3).value("text"); sheet.getRows(1,3).height(60);

You can try all of the above code in a web page which has initialized SpreadJS, to learn more about getting started with SpreadJS in a web page, please read Quick Start Guide to Using SpreadJS. For more information about how to use SpreadJS, includes its data model and API, please read our online documentation or try online demos.

MESCIUS inc.

comments powered by Disqus