---
title: "Cell"
language: "en"
type: "Symbol"
summary: "Cell[contents] is the low-level representation of a cell inside a Wolfram System notebook. Cell[contents,  style] represents a cell in the specified style. Cell[contents, SubscriptBox[style, 1], SubscriptBox[style, 2], ...] represents a cell with multiple styles applied to it."
keywords: 
- notebook content
- notebook cell structure
- fundamental notebook element
- notebook cell
- low-level notebook representation
- BoxData
- TextData
- StyleData
canonical_url: "https://reference.wolfram.com/language/ref/Cell.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Low-Level Notebook Structure"
    link: "https://reference.wolfram.com/language/guide/LowLevelNotebookStructure.en.md"
  - 
    title: "Low-Level Notebook Programming"
    link: "https://reference.wolfram.com/language/guide/LowLevelNotebookProgramming.en.md"
related_workflows: 
  - 
    title: "Create a Section Heading"
    link: "https://reference.wolfram.com/language/workflow/CreateASectionHeading.en.md"
  - 
    title: "Delete In, Out Cell Labels"
    link: "https://reference.wolfram.com/language/workflow/DeleteInOutCellLabels.en.md"
  - 
    title: "Programmatically Insert a Cell in a Notebook"
    link: "https://reference.wolfram.com/language/workflow/ProgrammaticallyInsertACellInANotebook.en.md"
  - 
    title: "Add a Banner to a Notebook"
    link: "https://reference.wolfram.com/language/workflow/AddABannerToANotebook.en.md"
related_functions: 
  - 
    title: "ExpressionCell"
    link: "https://reference.wolfram.com/language/ref/ExpressionCell.en.md"
  - 
    title: "TextCell"
    link: "https://reference.wolfram.com/language/ref/TextCell.en.md"
  - 
    title: "CellGroup"
    link: "https://reference.wolfram.com/language/ref/CellGroup.en.md"
  - 
    title: "Notebook"
    link: "https://reference.wolfram.com/language/ref/Notebook.en.md"
  - 
    title: "CellPrint"
    link: "https://reference.wolfram.com/language/ref/CellPrint.en.md"
  - 
    title: "CellObject"
    link: "https://reference.wolfram.com/language/ref/CellObject.en.md"
related_tutorials: 
  - 
    title: "Cells as Wolfram Language Expressions"
    link: "https://reference.wolfram.com/language/tutorial/ManipulatingNotebooks.en.md#24199"
  - 
    title: "The Structure of Cells"
    link: "https://reference.wolfram.com/language/tutorial/ManipulatingNotebooks.en.md#5793"
  - 
    title: "Options for Cells"
    link: "https://reference.wolfram.com/language/tutorial/ManipulatingNotebooks.en.md#3548"
---
# Cell

Cell[contents]
is the low-level representation of a cell inside a Wolfram System notebook. 
	Cell[contents,"style"] 
represents a cell in the specified style.
	Cell[contents,"Subscript[style, 1]","Subscript[style, 2]",\[Ellipsis]]
represents a cell with multiple styles applied to it.

## Details

* Wolfram System notebooks consist of lists of ``Cell`` objects.

* You can see the form of a cell as an expression by using the [Show Expression](https://reference.wolfram.com/language/ref/menuitem/ShowExpression.en.md) menu command in the standard Wolfram System front end.

* You can access cells in a notebook directly using the front end. You can also access the cells from the kernel using ``NotebookRead`` and ``NotebookWrite``, or using ``Options``, and ``SetOptions`` on ``NotebookSelection[obj]``.

* The contents of cells can be the following:

|                                          |                                         |
| :--------------------------------------- | :-------------------------------------- |
| "text"                                   | plain text                              |
| TextData[exprs]                          | general text objects                    |
| BoxData[boxes]                           | formatted Wolfram Language expressions  |
| OutputFormData["itext", "otext"]         | text as generated by OutputForm         |
| RawData[data]                            | unformatted expressions                 |
| GraphicsData["type", data]               | non-expression graphics or sound data   |
| CellGroupData[{cell1, cell2, …}, status] | group of cells                          |
| StyleData["style"]                       | sample cell for a particular style      |

* In any given notebook, a collection of possible cell styles is defined, typically with names such as ``"Title"``, ``"Section"``, ``"Input"``, and ``"Output"``.

* Cells can have many options, including:

|               |                                                         |
| :------------ | :------------------------------------------------------ |
| Background    | the color of the background for the cell                |
| CellFrame     | whether to draw a frame around the cell                 |
| CellTags      | tags for the cell                                       |
| Editable      | whether to allow the contents of the cell to be edited  |
| FontSize      | the default size of text in the cell                    |
| TextAlignment | how to align text in the cell                           |

---

## Examples (18)

### Basic Examples (2)

Create a text cell from a low-level description:

```wl
In[1]:= CellPrint[Cell["abc", "Text"]]
```

abc

---

Create an expression cell from a low-level description:

```wl
In[1]:= CellPrint[Cell[BoxData[SuperscriptBox["x", "2"]], "Print"]]

x^2
```

### Scope (5)

Cells can contain complex typeset forms:

```wl
In[1]:= CellPrint[Cell[BoxData[ToBoxes[Integrate[Abs[1 + Abs[x]], x, Assumptions -> x∈Reals]]], "Print"]]

Piecewise[{{x - x^2/2, x <= 0}}, x + x^2/2]
```

---

Cells can contain graphics:

```wl
In[1]:= CellPrint[Cell[BoxData[ToBoxes[Plot[Sin[x], {x, -2, 2}]]], "Print"]]

[image]
```

---

Cells can contain interactive controls:

```wl
In[1]:= CellPrint[Cell[BoxData[ToBoxes[Slider[]]], "Print"]]

Slider[0.5]
```

---

Cells can contain other cells:

```wl
In[1]:= CellPrint[Cell[TextData[{"the ", Cell[BoxData["x"]], " factor"}], "Text"]]
```

the x factor

---

Combine multiple styles in a cell:

```wl
In[1]:= CellPrint[Cell["I'm a TB cell", "TB"]];CellPrint[Cell["I'm a Small cell", "Small"]];CellPrint[Cell["I'm both", "TB", "Small"]];
```

I'm a TB cell

I'm a Small cell

I'm both

### Options (10)

#### CellFrame (1)

Put a frame around a cell:

```wl
In[1]:= CellPrint[Cell["abc", "Text", CellFrame -> True]]
```

abc

Specify a width for the frame:

```wl
In[2]:= CellPrint[Cell["abc", "Text", CellFrame -> 5]]
```

abc

#### CellFrameColor (1)

```wl
In[1]:= Do[CellPrint[Cell["abc", "Text", CellFrame -> 5, CellFrameColor -> c]], {c, {Red, Green, Blue}}]
```

abc

abc

abc

#### CellFrameLabels (2)

```wl
In[1]:= CellPrint[Cell["abc", "Text", CellFrame -> True, CellFrameLabels -> {{"L", "R"}, {"B", "T"}}]]
```

abc

---

Cell frame labels can be displayed without a frame:

```wl
In[1]:= CellPrint[Cell["abc", "Text", CellFrame -> False, CellFrameLabels -> {{"L", "R"}, {"B", "T"}}]]
```

abc

#### CellTags (1)

Use a cell tag to locate a particular cell by referring to the tag:

```wl
In[1]:= CellPrint[Cell["text", CellTags -> {"C1"}]]
```

text

```wl
In[2]:= NotebookLocate["C1"]
```

``NotebookFind`` can also be used:

```wl
In[3]:= NotebookFind[InputNotebook[], "C1", Next, CellTags];
```

#### Editable (1)

By default cells are editable; set ``Editable`` to ``False`` to disable this behavior:

```wl
In[1]:= CellPrint[Cell["not editable", "Text", Editable -> False]]
```

not editable

#### FontColor (1)

```wl
In[1]:= Do[CellPrint[Cell["text text", "Text", FontColor -> c]], {c, {Red, Green, Blue}}]
```

text text

text text

text text

#### FontSize (1)

```wl
In[1]:= Do[CellPrint[Cell["text", "Text", FontSize -> s]], {s, {12, 24, 36}}]
```

text

text

text

#### Hyphenation (1)

Define some text:

```wl
In[1]:= text = "Advanced experimentation with counterintuitively organized automatic aeronautically optimized mechanical anisotropic intermediaries";
```

The same text with and without hyphenation:

```wl
In[2]:= Do[CellPrint[Cell[text, "Text", CellMargins -> {{200, 250}, Inherited}, Hyphenation -> h]], {h, {True, False}}]
```

Advanced experimentation with counterintuitively organized automatic aeronautically optimized mechanical anisotropic intermediaries

Advanced experimentation with counterintuitively organized automatic aeronautically optimized mechanical anisotropic intermediaries

#### ShowCellBracket (1)

Cells with and without a cell bracket, and with a cell bracket that shows up only on mouseover:

```wl
In[1]:= Do[CellPrint[Cell["text text text", "Text", ShowCellBracket -> cb]], {cb, {False, True, Automatic}}]
```

text text text

text text text

text text text

### Properties & Relations (1)

``NotebookPut`` creates notebook windows from low-level ``Notebook`` and ``Cell`` expressions:

```wl
In[1]:= nb = NotebookPut[Notebook[{Cell["first"], Cell["last"]}]];
```

[image]

```wl
In[2]:= SelectionMove[nb, Next, Cell]
```

[image]

``NotebookRead`` returns a ``Cell`` expression for the selected cell:

```wl
In[3]:= NotebookRead[nb]

Out[3]= Cell["first"]
```

## See Also

* [`ExpressionCell`](https://reference.wolfram.com/language/ref/ExpressionCell.en.md)
* [`TextCell`](https://reference.wolfram.com/language/ref/TextCell.en.md)
* [`CellGroup`](https://reference.wolfram.com/language/ref/CellGroup.en.md)
* [`Notebook`](https://reference.wolfram.com/language/ref/Notebook.en.md)
* [`CellPrint`](https://reference.wolfram.com/language/ref/CellPrint.en.md)
* [`CellObject`](https://reference.wolfram.com/language/ref/CellObject.en.md)

## Tech Notes

* [Cells as Wolfram Language Expressions](https://reference.wolfram.com/language/tutorial/ManipulatingNotebooks.en.md#24199)
* [The Structure of Cells](https://reference.wolfram.com/language/tutorial/ManipulatingNotebooks.en.md#5793)
* [Options for Cells](https://reference.wolfram.com/language/tutorial/ManipulatingNotebooks.en.md#3548)

## Related Guides

* [Low-Level Notebook Structure](https://reference.wolfram.com/language/guide/LowLevelNotebookStructure.en.md)
* [Low-Level Notebook Programming](https://reference.wolfram.com/language/guide/LowLevelNotebookProgramming.en.md)

## Related Workflows

* [Create a Section Heading](https://reference.wolfram.com/language/workflow/CreateASectionHeading.en.md)
* [Delete In, Out Cell Labels](https://reference.wolfram.com/language/workflow/DeleteInOutCellLabels.en.md)
* [Programmatically Insert a Cell in a Notebook](https://reference.wolfram.com/language/workflow/ProgrammaticallyInsertACellInANotebook.en.md)
* [Add a Banner to a Notebook](https://reference.wolfram.com/language/workflow/AddABannerToANotebook.en.md)

## History

* Introduced in 1996 (3.0) \| [Updated in 2007 (6.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn60.en.md) ▪ [2017 (11.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn112.en.md)