Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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");
// Indent the string.cell = activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport);cell.textIndent(2);cell.value("Indent");

 

See Also
Setting Styles
Setting Text Decoration
wordWrap Method

  • No labels