# Column Formatting Technical Reference

Canonical page: https://www.adaptabletools.com/docs/technical-reference-styling-formatting

## Format Column State

| Property | Type | Description |
| --- | --- | --- |
| [FormatColumns](https://www.adaptabletools.com/docs/reference/formatcolumnstate.md#formatcolumns) | [`FormatColumn`](https://www.adaptabletools.com/docs/reference/formatcolumn.md)`[]` | Format Columns to apply. Several can match the same cell. Their styles are combined, and the first definition in this list wins on a property both set. A Styled Column wins over a Format Column where both set the same property. |

The order of elements is important as it defines their [Evaluation Precedence](https://www.adaptabletools.com/docs/handbook-column-formatting-configuring/index.md#format-column-precedence)

### Format Column

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [ColumnGroupScope](https://www.adaptabletools.com/docs/reference/formatcolumn.md#columngroupscope) | [`ColumnGroupScope`](https://www.adaptabletools.com/docs/reference/columngroupscope.md) | When a format applies to a column inside a column group.<br/><br/>Omit it to apply the format whether the parent group is expanded or collapsed. `'Expanded'` applies only while the parent group is expanded. `'Collapsed'` applies only while it is collapsed. `'Both'` applies in either state. A column that is the only leaf of a top-level group ignores an explicit scope. |   |
| [DisplayFormat](https://www.adaptabletools.com/docs/reference/formatcolumn.md#displayformat) | [`DisplayFormat`](https://www.adaptabletools.com/docs/reference/displayformat.md) | Display Format to apply to Column. Can be a concrete `AdaptableFormat`<br/>(Numeric, String or Date) **or** the name of a numeric preset such as<br/>`'Percentage'`, `'Thousand'`, `'Million'`, `'Dollar'`, `'Sterling'`,<br/>which is resolved at render time. |   |
| [Name](https://www.adaptabletools.com/docs/reference/formatcolumn.md#name) | `string` | Name of the Format Column definition |   |
| [RowScope](https://www.adaptabletools.com/docs/reference/formatcolumn.md#rowscope) | [`RowScope`](https://www.adaptabletools.com/docs/reference/rowscope.md) | Row kinds to skip. Each flag excludes that kind. When omitted, data, group, summary and total rows are all included. |   |
| [Rule](https://www.adaptabletools.com/docs/reference/formatcolumn.md#rule) | `string` | AdapTableQL boolean expression (evaluated per row) deciding whether to apply the Format, e.g. `[price] > 100`; if undefined the Format is always applied |   |
| [Scope](https://www.adaptabletools.com/docs/reference/formatcolumn.md#scope) | [`ColumnScope`](https://www.adaptabletools.com/docs/reference/columnscope.md) | Where Format will be applied: whole Row, some Columns, or Columns of DataType |   |
| [Style](https://www.adaptabletools.com/docs/reference/formatcolumn.md#style) | [`AdaptableStyle`](https://www.adaptabletools.com/docs/reference/adaptablestyle.md) | Colours, font and CSS class applied to the cell or header. Can be set together with `DisplayFormat`. |   |
| [Target](https://www.adaptabletools.com/docs/reference/formatcolumn.md#target) | [`FormatColumnTarget`](https://www.adaptabletools.com/docs/reference/formatcolumntarget.md) | Where in Column to apply Format (`cell` or `columnHeader`) | &#39;cell&#39; |
| [IsReadOnly](https://www.adaptabletools.com/docs/reference/formatcolumn.md#isreadonly) | `boolean` | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of &#39;Full&#39;) |   |
| [IsSuspended](https://www.adaptabletools.com/docs/reference/formatcolumn.md#issuspended) | `boolean` | Suspends (i.e. turns off) an Adaptable Object |   |

#### Scope

<ApiTypeCard name="ColumnScope" href="/docs/reference/columnscope" choice>

Which columns an object applies to. Set exactly one shape.

<ApiMember name="{ All: true }" href="/docs/reference/columnscope">

<ApiMemberType>

`true`

</ApiMemberType>

Matches every column. `All` must be `true`.

</ApiMember>

<ApiMember name="{ DataTypes }" href="/docs/reference/columnscope">

<ApiMemberType>

`('text' | 'number' | 'boolean' | 'date' | 'textArray' | 'numberArray')[]`

</ApiMemberType>

Data types to match, for example `['number']` or `['text', 'textArray']`. Object, tuple and unknown columns are not scope data types. Name those columns with `ColumnIds`.

</ApiMember>

<ApiMember name="{ ColumnIds }" href="/docs/reference/columnscope">

<ApiMemberType>

`string[]`

</ApiMemberType>

Column ids to match. These are AG Grid `colId` values.

</ApiMember>

<ApiMember name="{ ColumnTypes }" href="/docs/reference/columnscope">

<ApiMemberType>

`string[]`

</ApiMemberType>

AG Grid column type names, the strings set on `colDef.type`.

</ApiMember>

</ApiTypeCard>

`ColumnGroupScope` is a [`ColumnGroupScope`](https://www.adaptabletools.com/docs/reference/columngroupscope.md):

[See API: columngroupscope](https://www.adaptabletools.com/docs/reference/columngroupscope.md)

`RowScope` is a [`RowScope`](https://www.adaptabletools.com/docs/reference/rowscope.md):

| Property | Type | Description |
| --- | --- | --- |
| [ExcludeDataRows](https://www.adaptabletools.com/docs/reference/rowscope.md#excludedatarows) | `boolean` | Exclude regular data rows |
| [ExcludeGroupRows](https://www.adaptabletools.com/docs/reference/rowscope.md#excludegrouprows) | `boolean` | Exclude Group Rows |
| [ExcludeSummaryRows](https://www.adaptabletools.com/docs/reference/rowscope.md#excludesummaryrows) | `boolean` | Exclude Summary Rows (used in Row Summaries) |
| [ExcludeTotalRows](https://www.adaptabletools.com/docs/reference/rowscope.md#excludetotalrows) | `boolean` | Exclude Grand Total Rows (used in Aggregations) |

`Target` is a [`FormatColumnTarget`](https://www.adaptabletools.com/docs/reference/formatcolumntarget.md):

[See API: formatcolumntarget](https://www.adaptabletools.com/docs/reference/formatcolumntarget.md)

`DisplayFormat` is an [`AdaptableFormat`](https://www.adaptabletools.com/docs/reference/adaptableformat.md): a `NumberFormatter`, `DateFormatter`, or `StringFormatter`, each with its own `Options`.

### Style

Each [`Style`](https://www.adaptabletools.com/docs/reference/adaptablestyle.md) object is an [Adaptable Style](https://www.adaptabletools.com/docs/ui-tutorial-providing-adaptable-style/index.md) which defined as follows:

| Property | Type | Description |
| --- | --- | --- |
| [ClassName](https://www.adaptabletools.com/docs/reference/adaptablestyle.md#classname) | `string` | CSS class added to the cell. Colour, font and border properties on this object are still applied. |

### Display Formats

The DisplayFormat property is of type [`AdaptableFormat`](https://www.adaptabletools.com/docs/reference/adaptableformat.md) which can be one of 3 objects:

#### Numeric Format

The [`numberformatteroptions`](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md) provides Numeric Display Formats :

| Property | Type | Description |
| --- | --- | --- |
| [Abs](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#abs) | `boolean` | Returns absolute value of cell value |
| [Ceiling](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#ceiling) | `boolean` | Returns smallest integer greater than cell value |
| [Content](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#content) | `string \| number` | Replaces cell value with supplied value (that can contain Template Literals) |
| [Empty](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#empty) | `boolean` | Show nothing in cell (but underlying value remains) |
| [Floor](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#floor) | `boolean` | Returns largest integer cell value |
| [FractionDigits](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#fractiondigits) | `number` | Number of digits to show in Fractions (up to 20) |
| [FractionSeparator](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#fractionseparator) | `string` | Separator to use in fractions |
| [IntegerDigits](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#integerdigits) | `number` | Number of digits to show for Integers (up to 20) |
| [IntegerSeparator](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#integerseparator) | `string` | Separator to use in Integers |
| [Multiplier](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#multiplier) | `number` | Multiplier to use on cell value |
| [Notation](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#notation) | `'standard' \| 'scientific'` | Numeric notation to use when rendering the value.<br/><br/>- `'standard'` (default) — renders the number normally.<br/>- `'scientific'` — renders the number in scientific notation<br/> (e.g. `1.23e+5`). When set, `IntegerSeparator` is ignored<br/> and `FractionDigits` controls the number of mantissa digits. |
| [Parentheses](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#parentheses) | `boolean` | Shows negative numbers in parentheses |
| [Prefix](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#prefix) | `string` | Prefix to use before cell value |
| [Round](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#round) | `boolean` | Rounds cell value |
| [Suffix](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#suffix) | `string` | Suffix to use after cell value |
| [Truncate](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#truncate) | `boolean` | Truncates cell value |
| [ZeroDisplay](https://www.adaptabletools.com/docs/reference/numberformatteroptions.md#zerodisplay) | `string` | When the numeric value is zero (after multiplier and rounding):<br/>- omitted / undefined, or `'0'` — use normal formatting (e.g. `0`, `0.00`)<br/>- `''` — show a blank cell (user cleared the default `0` in the wizard)<br/>- any other string — show that text (e.g. `-`, `—`) |

#### String Format

The [`stringformatteroptions`](https://www.adaptabletools.com/docs/reference/stringformatteroptions.md) provides String Display Formats :

| Property | Type | Description |
| --- | --- | --- |
| [Case](https://www.adaptabletools.com/docs/reference/stringformatteroptions.md#case) | `'Upper' \| 'Lower' \| 'Sentence'` | Sets text to Upper, Lower or Sentence case |
| [Content](https://www.adaptabletools.com/docs/reference/stringformatteroptions.md#content) | `string` | Replaces cell value; useful when using Condition (e.g. replace null with &#39;N/A&#39;) |
| [Empty](https://www.adaptabletools.com/docs/reference/stringformatteroptions.md#empty) | `boolean` | Show nothing in cell (but underlying value remains) |
| [Prefix](https://www.adaptabletools.com/docs/reference/stringformatteroptions.md#prefix) | `string` | Prefix to use before the cell text |
| [Suffix](https://www.adaptabletools.com/docs/reference/stringformatteroptions.md#suffix) | `string` | Suffix to use after the cell text |
| [Trim](https://www.adaptabletools.com/docs/reference/stringformatteroptions.md#trim) | `boolean` | Trims text (both start and end) |

#### Date Format

The [`dateformatteroptions`](https://www.adaptabletools.com/docs/reference/dateformatteroptions.md) provides Date Display Formats :

| Property | Type | Description |
| --- | --- | --- |
| [Pattern](https://www.adaptabletools.com/docs/reference/dateformatteroptions.md#pattern) | `string` | Pattern to use for Date Format |

---

## Format Column Options

| Property | Type | Description |
| --- | --- | --- |
| [customDisplayFormatters](https://www.adaptabletools.com/docs/reference/formatcolumnoptions.md#customdisplayformatters) | [`CustomDisplayFormatter`](https://www.adaptabletools.com/docs/reference/customdisplayformatter.md)`[]` | Custom Formatters to use in Format Column Module |

#### Custom Display Formatters

| Property | Type | Description |
| --- | --- | --- |
| [handler](https://www.adaptabletools.com/docs/reference/customdisplayformatter.md#handler) | `(customDisplayFormatterContext: `[`CustomDisplayFormatterContext`](https://www.adaptabletools.com/docs/reference/customdisplayformattercontext.md)`) => any` | Function used to render the Custom Display Format |
| [id](https://www.adaptabletools.com/docs/reference/customdisplayformatter.md#id) | `string` | Custom Format Id |
| [label](https://www.adaptabletools.com/docs/reference/customdisplayformatter.md#label) | `string` | Custom Format Description |
| [scope](https://www.adaptabletools.com/docs/reference/customdisplayformatter.md#scope) | [`ColumnScope`](https://www.adaptabletools.com/docs/reference/columnscope.md) | Used by Format Columns wizard to show where Custom Display Format can be applied |

| Property | Type | Description |
| --- | --- | --- |
| [adaptableColumn](https://www.adaptabletools.com/docs/reference/customdisplayformattercontext.md#adaptablecolumn) | [`AdaptableColumn`](https://www.adaptabletools.com/docs/reference/adaptablecolumn.md) | Column where Custom Display Format will apply |
| [cellValue](https://www.adaptabletools.com/docs/reference/customdisplayformattercontext.md#cellvalue) | `any` | Non-formatted Cell Value |
| [rowNode](https://www.adaptabletools.com/docs/reference/customdisplayformattercontext.md#rownode) | `IRowNode` | Node where Custom Display Format will apply |
| [adaptableContext](https://www.adaptabletools.com/docs/reference/customdisplayformattercontext.md#adaptablecontext) | `any` | Custom application Context provided in `AdaptableOptions.adaptableContext` |

---

## Format Column API

| Method | Returns | Description |
| --- | --- | --- |
| [addFormatColumn(formatColumn)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#addformatcolumn) | [`FormatColumn`](https://www.adaptabletools.com/docs/reference/formatcolumn.md) | Adds a Format Column to Format Column State |
| [addFormatColumns(formatColumns)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#addformatcolumns) | [`FormatColumn`](https://www.adaptabletools.com/docs/reference/formatcolumn.md)`[]` | Adds Format Columns to Format Column State |
| [decrementFormatColumnPrecedence(formatColumn)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#decrementformatcolumnprecedence) | `void` | Moves a Format Column down so the formats above it are applied first. |
| [deleteAllFormatColumns()](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#deleteallformatcolumns) | `void` | Deletes all Format Columns in the State |
| [deleteFormatColumn(formatColumn)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#deleteformatcolumn) | `void` | Deletes an existing Format Column |
| [editFormatColumn(formatColumn)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#editformatcolumn) | [`FormatColumn`](https://www.adaptabletools.com/docs/reference/formatcolumn.md) | Edits the Format Column |
| [findFormatColumns(formatColumnLookupCriteria)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#findformatcolumns) | [`FormatColumn`](https://www.adaptabletools.com/docs/reference/formatcolumn.md)`[]` | Format Columns that match the given criteria. |
| [getActiveFormatColumns()](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#getactiveformatcolumns) | [`FormatColumn`](https://www.adaptabletools.com/docs/reference/formatcolumn.md)`[]` | Retrieves all active (not-suspended) Format Columns in Adaptable State |
| [getDisplayFormatForColumn(column, config)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#getdisplayformatforcolumn) | [`AdaptableFormat`](https://www.adaptabletools.com/docs/reference/adaptableformat.md)` \| undefined` | Retrieves the first Format Column&#39;s Adaptable Format for a given Column |
| [getFormatColumnByName(name)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#getformatcolumnbyname) | [`FormatColumn`](https://www.adaptabletools.com/docs/reference/formatcolumn.md)` \| undefined` | Retrieves a Format Column by its Name |
| [getFormatColumnByUuId(id)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#getformatcolumnbyuuid) | [`FormatColumn`](https://www.adaptabletools.com/docs/reference/formatcolumn.md) | Retrieves Format Column by the technical ID (from `FormatColumnState`) |
| [getFormatColumns()](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#getformatcolumns) | [`FormatColumn`](https://www.adaptabletools.com/docs/reference/formatcolumn.md)`[]` | Retrieves all Format Columns in Adaptable State |
| [getFormatColumnsForColumn(column, config)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#getformatcolumnsforcolumn) | [`FormatColumn`](https://www.adaptabletools.com/docs/reference/formatcolumn.md)`[]` | Gets all FormatColumns which are defined for the given column |
| [getFormatColumnsForColumnId(columnId, config)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#getformatcolumnsforcolumnid) | [`FormatColumn`](https://www.adaptabletools.com/docs/reference/formatcolumn.md)`[]` | Gets all FormatColumns which are defined for the column with the given columnId |
| [getFormatColumnState()](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#getformatcolumnstate) | [`FormatColumnState`](https://www.adaptabletools.com/docs/reference/formatcolumnstate.md) | Retrieves Format Column section from Adaptable State |
| [getSuspendedFormatColumns()](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#getsuspendedformatcolumns) | [`FormatColumn`](https://www.adaptabletools.com/docs/reference/formatcolumn.md)`[]` | Retrieves all suspended Format Columns in Adaptable State |
| [hasCustomDisplayFormatter(formatColumn)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#hascustomdisplayformatter) | `boolean` | Checks if a Format Column contains a Custom Display Formatter |
| [incrementFormatColumnPrecedence(formatColumn)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#incrementformatcolumnprecedence) | `void` | Moves a Format Column up so it is applied before the formats below it. |
| [openFormatColumnSettingsPanel()](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#openformatcolumnsettingspanel) | `void` | Opens Settings Panel with Format Column section selected and visible |
| [suspendAllFormatColumn()](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#suspendallformatcolumn) | `void` | Suspends all Format Columns |
| [suspendFormatColumn(formatColumn)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#suspendformatcolumn) | [`FormatColumn`](https://www.adaptabletools.com/docs/reference/formatcolumn.md) | Suspends an Format column |
| [unSuspendAllFormatColumn()](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#unsuspendallformatcolumn) | `void` | Activates all suspended Format Column |
| [unSuspendFormatColumn(formatColumn)](https://www.adaptabletools.com/docs/reference/formatcolumnapi.md#unsuspendformatcolumn) | [`FormatColumn`](https://www.adaptabletools.com/docs/reference/formatcolumn.md) | Activates a suspended Format Column. |
