docs/content/guides/cell-features/text-alignment/text-alignment.md
Align values within cells: horizontally (to the right, left, center, or by justifying them), and vertically (to the top, middle, or bottom of the cell).
[[toc]]
Apply text alignment to cells using CSS class names or the className configuration option.
To set alignment for individual cells, configure them using the cells option or the cell array. Available class names:
htLeft, htCenter, htRight, htJustifyhtTop, htMiddle, htBottomYou can track alignment changes by using the afterSetCellMeta hook.
To apply alignment globally or per column, provide the alignment details in the className option, for example:
::: only-for javascript
className: 'htCenter'
:::
::: only-for react
className="htCenter"
:::
::: only-for angular
settings = { className: "htCenter" };
:::
The following code sample configures the grid to use htCenter and configures individual cells to use different alignments.
::: only-for javascript
::: example #example1 --js 1 --ts 2
:::
:::
::: only-for react
::: example #example1 :react --js 1 --ts 2
:::
:::
::: only-for angular
::: example #example1 :angular --ts 1 --html 2
:::
:::
Configuration options
<div class="boxes-list"> </div>Hooks
<div class="boxes-list"> </div>Cells display the configured horizontal or vertical alignment. Global settings apply to all cells, and per-cell settings take precedence over the global defaults.