ItemStyle
Details
- ItemStyle->s specifies that all items should use style specification s.
- Item style specifications can include all options to Item, as well as options to Style. Directive[opt1,opt2,…] can be used to specify multiple options.
- Item style specifications are applied to the complete region of an item, not just its contents, so that, for example, backgrounds extend to the edge of the item.
- The settings for ItemStyle can be given as follows to apply separately to different items:
-
spec apply spec to all items {specx} apply specx at successive horizontal positions {specx,specy} apply speck at successive horizontal and vertical positions 
also allow explicit rules for individual i,j elements - The speck can have the following forms:
-
{s1,s2,…,sn} use s1 through sn; then use defaults {{c}} use c in all cases {{c1,c2}} alternate between c1 and c2 {{c1,c2,…}} cycle through all ci {s,{c}} use s, then repeatedly use c {s1,{c},sn} use s1, then repeatedly use c, but use sn at the end {s1,s2,…,{c1,c2,…},sm,…,sn} use the first sequence of si at the beginning, then cyclically use the ci, then use the last sequence of si at the end {s1,s2,…,{},sm,…,sn} use the first sequence of si at the beginning and the last sequence at the end {i1->v1,i2->v2,…} specify what to use at positions ik {spec,rules} use rules to override specifications in spec - If multiple speci or rules specify styles for a particular element, the styles are combined in the order they appear.
Examples
open all close allBasic Examples (3)
Style all the elements in the grid:
Grid[Table[x, {4}, {7}], ItemStyle -> Red]Grid[Table[x, {4}, {7}], ItemStyle -> {Automatic, {Red}}]Use a style from the current stylesheet:
Grid[{{"h1", "h2", "h3"}, {x, x, x}, {x, x, x}}, ItemStyle -> {Automatic, {"Subsection"}}]Scope (6)
Blue and red font colors for the first and second horizontal positions:
Grid[Table[x, {4}, {7}], ItemStyle -> {{Blue, Red}, None}]Blue and red font colors for the first and last horizontal positions:
Grid[Table[x, {4}, {7}], ItemStyle -> {{Blue, {}, Red}, None}]Blue and red font colors for the first and second vertical positions:
Grid[Table[x, {4}, {7}], ItemStyle -> {Automatic, {Blue, Red}}]Alternating blue and red font colors:
Grid[Table[x, {4}, {7}], ItemStyle -> {{{Blue, Red}}, None}]Alternating font colors with orange superimposed in the first and last positions:
Grid[Table[x, {4}, {7}], ItemStyle -> {{{{Blue, Red}}, {1 -> Orange, -1 -> Orange}}, Automatic}]Grid[Table[x, {4}, {7}], ItemStyle -> {Automatic, Automatic, {{1, 1} -> Red, {3, 3} -> Red}}]Grid[Table[x, {4}, {7}], ItemStyle -> {Automatic, Automatic, {{{1, 3}, {2, 4}} -> Red}}]Overlapping specifications are unified when possible:
Grid[Table[x, {4}, {7}], ItemStyle -> {1 -> Red, 1 -> 16}]Generalizations & Extensions (1)
Color negative numbers red in Dataset:
Dataset[Table[RandomReal[{-1, 1}], {5}, {3}], ItemStyle -> (If[# < 0, Red, Automatic]&)]Properties & Relations (1)
BaseStyle can be used to specify a style for the entire grid:
Grid[Table[x, {4}, {7}], BaseStyle -> Red]Possible Issues (2)
Column styles have precedence over row styles:
Grid[Table[x, {4}, {7}], ItemStyle -> {1 -> Directive[Red, 14], 1 -> 16}]Use Directive to wrap multiple style directives:
Grid[Table[x, {4}, {7}], ItemStyle -> Directive[FontSize -> 16, Red, Italic]]See Also
Tech Notes
Related Guides
History
Text
Wolfram Research (2007), ItemStyle, Wolfram Language function, https://reference.wolfram.com/language/ref/ItemStyle.html.
CMS
Wolfram Language. 2007. "ItemStyle." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ItemStyle.html.
APA
Wolfram Language. (2007). ItemStyle. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ItemStyle.html
BibTeX
@misc{reference.wolfram_2026_itemstyle, author="Wolfram Research", title="{ItemStyle}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/ItemStyle.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_itemstyle, organization={Wolfram Research}, title={ItemStyle}, year={2007}, url={https://reference.wolfram.com/language/ref/ItemStyle.html}, note=[Accessed: 12-June-2026]}