OGE logoOGE

Conditional Formatting

Style rows and cells from your data without templates: class hooks, declarative formatting rules, data bars, colour scales and icon sets. Every visual is a design-token class or a CSS custom property, so themes, dark mode and Windows High Contrast keep working.

rowClass cellClass conditionalFormats cellPrepared mergeCells cellSpan

Class hooks & formatting rules

rowClass / cellClass return a string, an array or a { class: condition } record. A column's conditionalFormats mixes rules (when as a predicate or an { operator, value } condition, painted with a token tone / background) with a data bar and an icon set relative to the rendered rows. cellPrepared hands over the element for anything else.

tokens only forced colors
Name
Department
Salary
Score
Elif
HR
77000
1
Mert
Finance
44000
2
Zeynep
Engineering
81000
3
Deniz
Finance
35000
4
Ayşe
Sales
81000
5
Mert
Engineering
105000
6
Elif
Engineering
34000
7
Emre
Sales
96000
8
Elif
Support
40000
9
Zeynep
Support
86000
10
Emre
HR
109000
11
Ali
HR
39000
12
Selin
Finance
73000
13
Selin
Engineering
88000
14
Zeynep
Finance
55000
15
Mehmet
Sales
79000
16
Selin
Engineering
106000
17
Ali
HR
102000
18
Can
Support
118000
19
Zeynep
HR
35000
20
Deniz
Sales
63000
21
Mehmet
Sales
87000
22
Mert
Support
86000
23
Ali
Finance
40000
24
Can
HR
93000
25
Mehmet
Finance
80000
26
Mert
HR
52000
27
Emre
Support
71000
28
Ali
Support
81000
29
Mert
Engineering
64000
30
Mert
HR
61000
31
Elif
Sales
66000
32
Ali
Finance
49000
33
Can
Sales
112000
34
Ayşe
Finance
112000
35
Zeynep
HR
116000
36
Deniz
Engineering
41000
37
Selin
Engineering
45000
38
Can
Sales
97000
39
Mert
Sales
110000
40

Merged cells, spans, auto-fit & hints

mergeCells merges equal adjacent values into one cell with aria-rowspan; cellSpan returns { rowSpan, colSpan } per cell. The arrow keys step over a merged area. columnAutoWidth sizes the columns to their content (double-click a resize handle, or use the header menu's Size to fit, for one column), and cellHintEnabled shows truncated text in a tooltip on hover and on keyboard focus.

aria-rowspan cellHintEnabled auto-fit
Department
City
First name
Last name
Engineering
İzmir
Deniz
Bursa
Deniz
Demir
Antalya
Selin
Demir
Ankara
Can
Çelik
Finance
Ankara
Ali
Şahin
HR
Bursa
Can
Yılmaz
Ankara
Ayşe
Doğan
Antalya
Mert
Aydın
Sales
Bursa
Elif
Kaya
Bursa
Emre
Öztürk
Support
Bursa
Zeynep
Demir
Ankara
Zeynep
Şahin
İstanbul
Elif
Demir
Bursa
Ayşe
Kılıç

Notes

  • Data bars and colour scales are relative to the column's numeric range over the rendered rows unless min / max are given; icon sets split that range in thirds unless thresholds are given.
  • Spans never cross group rows and are not applied while the grid is virtualized; row spans assume uniform row heights.