You can align or indent text in a cell. You can specify the vertical and horizontal alignment using the hAlign and vAlign methods. Specify the indent using the textIndent method.
Using Code
This example sets the vertical and horizontal alignment for cell B2 and specifies a text indent for cell B3.
JavaScript |
Copy Code |
// Set the horizontal and vertical alignment to centervar cell = activeSheet.getCell(1, 1, GC.Spread.Sheets.SheetArea.viewport);cell.hAlign(GC.Spread.Sheets.HorizontalAlign.center);cell.vAlign(GC.Spread.Sheets.VerticalAlign.center);cell.value("Alignment"); |
|
See Also
Setting Styles
Setting Text Decoration
wordWrap Method