Conditional formatting lets you dynamically change the **text color**, **background color** and **disable action button** of Table columns based on cell values or row data. You can use it to highlight important data, flag anomalies, or visually categorize records, all without writing a separate query or adding extra components.
Each column in the Table component has **Text Color** and **Cell Color** style properties. By default, these accept a static color value. Clicking the **fx** icon next to these properties lets you write JavaScript expressions inside `{{ }}` that evaluate per row at render time.
Two identifiers are available inside these expressions:
| Identifier | Description |
|:-----------|:------------|
| `cellValue` | The value of the current cell in that row. Use this when the formatting condition depends on the column's own data. |
| `rowData` | An object containing all column values for the current row. Use this when the formatting condition depends on data from other columns. |
:::info
To learn more about writing dynamic expressions, see [Using fx for Dynamic Behaviour](/docs/app-builder/custom-code/fx-dynamic-behaviour).
Use nested ternary operators or logical operators to build more complex rules. For example, format a **Name** column by combining `id` and `phone` from row data:
When using **[Dynamic Columns](/docs/widgets/table/dynamic-column)**, you can set conditional formatting directly in the column JSON definition using the `textColor` and `cellBackgroundColor` keys:
You can conditionally disable action buttons on a per-row basis using the same `cellValue` and `rowData` identifiers available in conditional formatting. A disabled button appears greyed out and cannot be clicked.
### Configuration
1. Click the **Table** component to open the properties panel.
2. Go to the **Action Buttons** section and select the action button you want to configure.
3. Find the **Disable action button** property.
4. Click the **fx** icon to switch to a dynamic expression.
5. Enter a JavaScript expression using `cellValue` or `rowData` that returns `true` to disable the button or `false` to keep it enabled.
### Examples
**Disable based on row status**
Disable a button when the row's `status` is `completed`:
```js
{{rowData.status === 'completed'}}
```
**Disable based on a numeric threshold**
Disable a "Refund" button when the `amount` is zero or negative:
```js
{{rowData.amount <= 0}}
```
**Disable based on multiple conditions**
Disable an "Approve" button when the row is already approved or the user role is `viewer`: