# Display Format using Templates

Canonical page: https://www.adaptabletools.com/docs/handbook-column-formatting-display-format-template

- AdapTable enables Display Formats to be created with Template Literals
- These are then dynamically converted using string interpolation

Developers and runtime users can leverage Template Literals when providing a Display Format.

- Template Literals are supplied as part of the Format Column definition
- They are placed in the `Content` property in `Options` property of `DisplayFormat` object

When the cell is rendered the Template Literal is evaluated using string interpolation and the derived substitute text is displayed

Template Literals can be used when providing [String Display Formats](https://www.adaptabletools.com/docs/handbook-column-formatting-display-format-string/index.md) and [Number Display Formats](https://www.adaptabletools.com/docs/handbook-column-formatting-display-format-number/index.md)

## Template Literal Properties

There are 3 Display Format Template Literals available:

| Template Literal | Displays                                     |
| ---------------- | -------------------------------------------- |
| `[column]`       | Friendly Name of Formatted Column            |
| `[value]`        | Non-formatted value for the Cell             |
| `[rowData.x]`    | Other values in Row (e.g. `[rowData.price]`) |

**Example: Column Formatting: Template Literal Display Formats**

Column Formatting with Placeholder Display Formats

- This example shows 2 columns with Display Formats that contain Template Literals:
  - `Name` also contains the value of the `language` data value in the row
  - `GitHub Stars` adds the word 'Stars' after the value

Demo project (Vanilla); the files without a marker are shown below:

```text
src/
  adaptableOptions.ts
  agGridModules.ts     [template]
  columnDefs.ts        [template]
  gridOptions.ts       [template]
  index.ts             [template]
  onAdaptableReady.ts  [template]
  rowData.ts           [template]
  styles.css           [template]
index.html             [template]
package.json           [template]
tsconfig.json          [template]
```

Files marked `[template]` are the same in every demo; see the [demo template](https://www.adaptabletools.com/llms/demo-template.md#vanilla).

**`src/adaptableOptions.ts`**

```ts
import {AdaptableOptions} from '@adaptabletools/adaptable';
import {WebFramework} from './rowData';

export const adaptableOptions: AdaptableOptions<WebFramework> = {
  primaryKey: 'id',
  adaptableId: 'Template Display Formats',
  initialState: {
    Dashboard: {
      ModuleButtons: ['FormatColumn'],
    },
    Theme: {CurrentTheme: 'dark'},
    Layout: {
      CurrentLayout: 'Standard Layout',
      Layouts: [
        {
          Name: 'Standard Layout',
          TableColumns: [
            'name',
            'license',
            'github_stars',
            'github_watchers',
            'week_issue_change',
            'created_at',
            'updated_at',
            'closed_pr_count',
            'description',
          ],
          AutoSizeColumns: true,
        },
      ],
    },
    FormatColumn: {
      FormatColumns: [
        {
          Name: 'formatColumn-name',
          Scope: {
            ColumnIds: ['name'],
          },
          DisplayFormat: {
            Formatter: 'StringFormatter',
            Options: {
              Content: '[value] ([rowData.language])',
            },
          },
        },
        {
          Name: 'formatColumn-github_stars',
          Scope: {
            ColumnIds: ['github_stars'],
          },
          DisplayFormat: {
            Formatter: 'NumberFormatter',
            Options: {
              Content: '[value] Stars',
            },
          },
        },
      ],
    },
  },
};
```
