# CellAlignment

New to Analytica 5.0

## CellAlignment( horiz, indent, vert, vertIndent )

Specifies the text alignment (justification) or indention for a cell in a table. This is used from within a Cell Format Expression attribute, see Computed cell formats for an overview of using computed formats.

Parameters:

• «horiz»: The horizontal alignment. One of: 'Left', 'Center' or 'Right'.
• «indent»: An indention amount, in units equal to the width of one space character. For 'Left' alignment, this is a margin to the left of the text, for 'Right' it is a margin to the right of the text, and for 'Center' it is a margin on both sides.
• «vert»: The vertical alignment. One of 'Top', 'Middle', or 'Bottom'.
• «vertIndent»: Vertical margin in pixel units. For 'Top', this is a margin above the text, for 'Bottom' it is a margin below the text, and for 'Middle' it is a margin on both sides.

The «horiz» and «vert» parameters also accept 'Default', 'Justify', 'Fill', and 'Distributed'. However, these modes are not honored -- instead it just maps to the most appropriate justification among the stated options. When reading cell justifications in an excel spreadsheet, these values are possible (e.g., from SpreadsheetCell with «what» set to 'HorizontalAlignment' or 'VerticalAlignment').

## Examples

These would appear in the Cell Format Expression attribute.

CellAlignment( 'Center' )
CellAlignment( If IsNumber(Self) Then 'Right' Else 'Left' )
CellSpan( LineItem, CellAlignment(vert:'Middle'), header:true )

In the next example, there is an index named Place, and a variable Place_level indexed by Place, with a 0 for each state, a 1 for each county, and a 2 for each city.

CellSpan(Place, CellAlignment(indent:Place_level*3), header:true)

: