Databricks notebook interface and controls
Learn how to use the Databricks notebook toolbar and menus to control the notebook and cell display settings.
Notebook table of contents
To display an automatically generated table of contents, click the icon at the upper left of the notebook (between the left sidebar and the topmost cell). The table of contents is generated from the Markdown headings used in the notebook. Cells with titles also appear in the table of contents.
Add a cell title
To add a title to a cell, do one of the following:
- Click the cell number at the center of the top of the cell and type the title.
- Select Add title from the cell actions menu.
Cells with titles appear in the notebookâs table of contents.
Promoted cell titles
To make cell titles more visible in the UI, users can enable Show promoted cell titles.
- In the upper-right corner of any page, click your profile photo, then click Settings.
- Click Developer > Enable Show promoted cell titles.
Hide and show cell content
Cell content consists of cell code and the results of running the cell. To hide cell code or results, click the kebab menu at the upper-right of the cell and select Hide code or Hide result.
You can also select Collapse cell to display only the first line of a cell. To expand a collapsed cell, select Expand cell.
To show hidden cells, click the show icon: .
Collapsible headings
Cells that appear after cells containing Markdown headings can be collapsed into the heading cell. To expand or collapse cells after cells containing Markdown headings throughout the notebook, select Collapse all headings from the View menu. The rest of this section describes how to expand or collapse a subset of cells.
Expand and collapse headings
The image shows a level-two heading MLflow setup with the following two cells collapsed into it.
To expand and collapse headings, hover your cursor over the Markdown cell. Click the arrow that appears to the left of the cell.
Cell display options
There are three display options for notebooks. Use the View menu to change the display option.
- Standard view: results are displayed immediately after code cells.
- Results only: only results are displayed.
- Side-by-side: code and results cells are displayed side by side.
Actions are available from icons in the cell gutter (the area to the right and left of the cell). For example, use the grip dots to move a cell up or down in the left gutter. To delete a cell, use the trash can icon in the right gutter.
For easier editing, click the focus mode icon to display the cell at full width. To exit focus mode, click . You can also enlarge the displayed width of a cell by turning off View > Centered layout.
To automatically format all cells in the notebook to industry standard line lengths and spacing, select Edit > Format notebook.
Remove cell margins
You can expand or minimize margins by clicking View > Notebook layout in the notebook menu.
Line and command numbers
To show or hide line numbers or command numbers, select Line numbers or Command numbers from the View menu. For line numbers, you can also use the keyboard shortcut Control+L. When a cell is in an error state, line numbers are displayed regardless of the selection.
If you enable line or command numbers, Databricks saves your preference and shows them in all of your other notebooks for that browser.
Line wrapping
You can enable or disable line wrapping in notebook cells, allowing text to either wrap onto multiple lines or remain on a single line with horizontal scrolling.
- In the upper-right corner of any page, click your profile photo, then click Settings.
- Click Developer settings > Wrap lines.
View notebooks in dark mode
You can choose to display notebooks in dark mode. To turn dark mode on or off, select View > Theme and select Light theme or Dark theme.
ble line or command numbers, Databricks saves your preference and shows them in your other notebooks for that browser.
Browse data
To explore tables and volumes available to use in the notebook, click on the left side of the notebook to open the schema browser. See Browse data for more details.