is an option for Dataset that specifies a function to apply to items before displaying them.
ItemDisplayFunction
is an option for Dataset that specifies a function to apply to items before displaying them.
Details
- The setting for ItemDisplayFunction can be any pure function.
- With the option ItemDisplayFunctionf, the specified function will be applied to all items in the dataset before displaying them.
- With the option ItemDisplayFunctionf, the displayed item is given by f[item,position,dataset].
- The settings for ItemDisplayFunction can be given as follows to apply separately to different items:
-
spec apply spec to all items {spec1,spec2,…,specn} apply speck to items at dataset level k 
also allow explicit rules for individual items - 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 - Rules have the form ispec, where i specifies a position in the dataset.
- Positions can be patterns.
- The position of an item can be read at the bottom of a dataset when you hover over the header.
- If the left-hand side of a rule is not a list, the setting is applied to any position that contains the left-hand side as a key or index.
Examples
open all close allBasic Examples (2)
Applications (1)
Possible Issues (1)
The value of ItemDisplayFunction must be an explicit pure function. Other values will have no effect:
Dataset[Take[...], ItemDisplayFunction -> Framed]Use an explicit pure function:
Dataset[Take[...], ItemDisplayFunction -> (Framed[#]&)]Interactive Examples (1)
Neat Examples (1)
Display Titanic passenger data using a bar chart for age, a symbol for sex and a check mark if the passenger survived:
Dataset[Take[...], ItemDisplayFunction -> {
"age" -> (Style[Spacer[{2 #, 15}], Background -> Cyan]&),
"sex" -> (If[# === "male", ♀, ♂]&),
"survived" -> (If[#, "✓", ""]&)
}]History
Text
Wolfram Research (2020), ItemDisplayFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/ItemDisplayFunction.html.
CMS
Wolfram Language. 2020. "ItemDisplayFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ItemDisplayFunction.html.
APA
Wolfram Language. (2020). ItemDisplayFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ItemDisplayFunction.html
BibTeX
@misc{reference.wolfram_2026_itemdisplayfunction, author="Wolfram Research", title="{ItemDisplayFunction}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ItemDisplayFunction.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_itemdisplayfunction, organization={Wolfram Research}, title={ItemDisplayFunction}, year={2020}, url={https://reference.wolfram.com/language/ref/ItemDisplayFunction.html}, note=[Accessed: 13-June-2026]}