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,"style1","style2",]

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 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:
  • Backgroundthe color of the background for the cell
    CellFramewhether to draw a frame around the cell
    CellTagstags for the cell
    Editablewhether to allow the contents of the cell to be edited
    FontSizethe default size of text in the cell
    TextAlignmenthow to align text in the cell

Examples

open allclose all

Basic Examples  (2)

Create a text cell from a low-level description:

Create an expression cell from a low-level description:

Scope  (5)

Cells can contain complex typeset forms:

Cells can contain graphics:

Cells can contain interactive controls:

Cells can contain other cells:

Combine multiple styles in a cell:

I'm a TB cell
I'm a Small cell
I'm both

Options  (10)

CellFrame  (1)

Put a frame around a cell:

Specify a width for the frame:

CellFrameColor  (1)

CellFrameLabels  (2)

Cell frame labels can be displayed without a frame:

CellTags  (1)

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

text

NotebookFind can also be used:

Editable  (1)

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

FontColor  (1)

FontSize  (1)

Hyphenation  (1)

Define some text:

The same text with and without hyphenation:

ShowCellBracket  (1)

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

Properties & Relations  (1)

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

NotebookRead returns a Cell expression for the selected cell:

Introduced in 1996
 (3.0)
 |
Updated in 2007
 (6.0)
2017
 (11.2)