CellGroupData[{cell1,cell2,…}]
is a low-level construct that represents an open group of cells in a notebook.
CellGroupData[{cell1,cell2,…},status]
represents a cell group that is open or closed according to the value of status.
CellGroupData[{cell1,cell2,…},{i1,i2,…}]
represents a cell group with cells at positions i1, i2, … open.
CellGroupData
CellGroupData[{cell1,cell2,…}]
is a low-level construct that represents an open group of cells in a notebook.
CellGroupData[{cell1,cell2,…},status]
represents a cell group that is open or closed according to the value of status.
CellGroupData[{cell1,cell2,…},{i1,i2,…}]
represents a cell group with cells at positions i1, i2, … open.
Details
- Cell groups are typically opened and closed by double‐clicking their cell brackets or opener icons.
- status may take the value of Closed or Open. False and True may also be used.
- CellGroupData[cells,Dynamic[status]] will reset the value of status when the cell group is interactively opened or closed. It will open or close the cell group when the value of status is set.
- When cells are entered into a notebook, they are automatically placed in groups unless CellGrouping->Manual is set.
Examples
Basic Examples (4)
Create a notebook that has automatic cell grouping:
nb = CreateDocument[{TextCell["heading", "Section"], TextCell["text", "Text"]}];NotebookRead shows the CellGroupData structure:
SelectionMove[nb, All, Notebook];NotebookRead[nb]Create a document with manually grouped cells:
nb = NotebookPut[Notebook[{CellGroupData[{Cell["text 1", "Text"], Cell["text 2", "Text"]}, Open]}, CellGrouping -> Manual]];Create a group with only the second cell open:
nb = NotebookPut[Notebook[{CellGroupData[{Cell["text 1", "Text"], Cell["text 2", "Text"], Cell["text 3", "Text"]}, {2}]}, CellGrouping -> Manual]];Create a group with its first and third cells open:
nb = NotebookPut[Notebook[{CellGroupData[{Cell["text 1", "Text"], Cell["text 2", "Text"], Cell["text 3", "Text"]}, {1, 3}]}, CellGrouping -> Manual]];Tech Notes
Related Guides
History
Introduced in 1996 (3.0) | Updated in 2007 (6.0)
Text
Wolfram Research (1996), CellGroupData, Wolfram Language function, https://reference.wolfram.com/language/ref/CellGroupData.html (updated 2007).
CMS
Wolfram Language. 1996. "CellGroupData." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/CellGroupData.html.
APA
Wolfram Language. (1996). CellGroupData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CellGroupData.html
BibTeX
@misc{reference.wolfram_2026_cellgroupdata, author="Wolfram Research", title="{CellGroupData}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/CellGroupData.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_cellgroupdata, organization={Wolfram Research}, title={CellGroupData}, year={2007}, url={https://reference.wolfram.com/language/ref/CellGroupData.html}, note=[Accessed: 12-June-2026]}