• Products
  • Documentation
  • Resources

Insert the table of contents macro

The table of contents macro scans the headings on the current Confluence page to create a table of contents based on those headings. This helps readers find their way around lengthy pages by summarizing the content structure and providing links to headings. 

To add a table of contents to your page: 

  1. When editing, select from the toolbar

  2. Find the macro by name and select it

  3. Configure it as needed

You can also type / on the page to bring up the same list you'd see by selecting from the toolbar. Continue typing the name of the macro to filter the list.

To configure your table of contents: 

  1. Select the macro placeholder.

  2. Select the Edit icon to open the configuration panel.

  3. Configure the parameters. Your changes are saved as you go.

  4. Resume editing the page, and the panel closes.

You can also select the centered , medium-width , and full-width icons to adjust the width of some macros. Select the trashcan iconto remove the macro.

The table of contents macro offers Basic or Advanced configuration options.

Your selections will display immediately. When you preview the page or publish it, you’ll be able to check how your customized table of contents looks.

  • When you use a table of contents macro in a template, it won’t render in the template itself. But the macro will always work on pages created from the template after the page has been saved.

  • The macro only displays page or blog post content. Any text formatted as a heading can be included in your table of contents, along with heading-formatted emojis, mentions, statuses, and dates.

  • The macro only works within the page, blog, or macro to which it has been added, and cannot reference or be referenced across multiple pages or blogs. When added to an excerpt macro, for example, it will only display headings located inside the excerpt and those heading links won’t navigate to the source page. 

Parameters

To customize your table of contents, you can configure its basic and/or advanced parameters.

Basic parameters

Basic parameter

Default

Description

Display as

Vertical list

  • Vertical list produces a typical list-type table of contents.

  • Horizontal list produces a flat, horizontal menu-type series of links.

Bullet style

Bullet

This parameter applies to vertical lists only. Select from any of the following values:

  • None
    No bullets are displayed

  • Mixed 
    The bullet style is a mix of shapes (filled and open)

  • Bullet
    The bullet style is a filled circle

  • Circle 
    The bullet style is an open circle

  • Square
    The bullet style is a filled square

  • Numbered
    The list is numbered (1, 2, 3, 4, 5)

Separate sections by

Bracket

This parameter applies to horizontal lists only.

Select from any of the following values:

  • Bracket
    Each item is enclosed by square brackets: [ ]

  • Brace
    Each item is enclosed by braces: { }

  • Pipe
    Each item is separated by a pipe: |

Include heading levels from [#] to [#]

1 to 6

Select the minimum and maximum heading levels to include in your table of contents.

Include section numbers

Unchecked

Select the checkbox to apply outline numbering to your headings. As an example: section 1.1, 1.2, 1.3.

Advanced parameters

If the parameter name used in Confluence Cloud storage format is different than the label used when inserting macros with the browser or the slash command, it will be listed below in brackets (example).

Advanced parameter

Description

Indent headings
(indent

Sets the indent for a vertical list according to a valid CSS unit value.

Entering 10px will successively indent heading groups by 10px. Level 1 headings will be indented 10px and level 2 headings will be indented an additional 10px.

Include headings with:
(include

Filter headings to include in your table of contents by inputting specific criteria. You can use wildcard characters and this field is case sensitive.

As an example, if you only want headings with the words “Overview” and “Summary” to appear, you’d enter Overview|Summary in this field.

Exclude headings with:
(exclude

Filter headings to exclude from your table of contents by inputting specific criteria, separated by vertical lines { | }. This field is case sensitive.

As an example, if you want to exclude headings with the words “Overview” and “Summary” from the table of contents, you’d enterOverview|Summary in this field.

CSS class name
(class

If you have custom table of contents styles in your CSS style sheet, use this parameter to output the table of contents inside <div tags with the specified class attribute.

Exclude in PDF export
(printable

If the box is checked, the table of contents will not be visible when you export the page to PDF or print it.

 

Still need help?

The Atlassian Community is here for you.