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.
Use the Table of Contents macro
To add the Table of Contents macro:
- In the Confluence editor, select > View more
- Find the item to be inserted and select it
- Select Insert
You can also type / onto the page to bring up the same list you'd see by selectingfrom the toolbar.
To edit the Table of Contents macro:
- Select the macro placeholder. The floating toolbar appears.
- Select Edit. The right panel opens.
- Modify the parameters. Your changes are saved as you go.
- Resume editing the page, and the panel closes.
Parameters are options that you can set to control the content or format of the macro output. Where the parameter name used in Confluence storage format or wikimarkup is different to the label used in the browser, it will be listed below in brackets (
Display Section Numbering
Select the check box to apply outline numbering to your headings, for example: 1.1, 1.2, 1.3.
Select the style of bullet point for each list item. You can use any valid CSS style. For example:
Sets the indent for a list according to CSS quantities. Entering
This parameter applies to flat lists only. You can enter any of the following values:
Minimum Heading Level
Select the highest heading level to start your TOC list. For example, entering 2 will include levels 2, and lower, headings, but will not include level 1 headings.
Maximum Heading Level
Select the lowest heading level to include. For example, entering 2 will include levels 1 and 2, but will not include level 3 headings and below.
Filter headings to include according to specific criteria. You can use wildcard characters.
If you only want the Overview and Summary headings to appear, enter
This field is case-sensitive. Enter both forms of the word if you want both instances to be included.
Filter headings to exclude according to specific criteria. You can use wildcard characters.
If the headings you want to exclude are Overview and Summary, enter
This field is case-sensitive. Enter both forms of the word if you want both instances to be excluded.
|By default, the TOC is set to print. If you clear the check box, the TOC will not be visible when you print the page.|
CSS Class Name
If you have custom TOC styles in your CSS style sheet, use this parameter to output the TOC inside
|Absolute URL ||By default, the links in the TOC are relative URLs pointing to the current page. If checked, the links in the TOC will be full URLs.|
The examples below are based on this table of contents:
Want to see the Table of Contents macro in action? Check out how it's used in Creating insightful customer interview pages.
Filtered Table of Contents
This example filters the headings to include those that contain 'Favorite', but excludes headings which end with 'Things'. The list is styled with Roman numerals.
The resulting table of contents is:
This example filters all headings to render a flat list of 'Unknowns' enclosed in square brackets (the default list style).
|Maximum Heading Level|
The resulting table of contents is:
Wiki markup example
Wiki markup is only supported in the legacy editor.
Wiki markup is useful when you need to add a macro outside the editor, for example as custom content in the sidebar, header or footer of a space.
Macro body: None.
This example shows a list-type table of contents.
This example shows a flat table of contents.
- When you use a Table of Contents macro in a template, you will see an error when you preview the template itself. But the Table of Contents macro works on the pages that people create from the template – the table of contents shows up after they have saved the page. (This is probably because the template is not defined as a page, and the Table of Contents macro works for pages only.)
- The Table of Contents macro only displays page or blog post content. You can't use it to add a table of contents of headings in a comment for example.
- Due to an outstanding issue in the Table of Contents macro (CONF-10619), the macro browser's Refresh function does not render any parameter modifications. Currently, the rendering of parameter value modifications to the Table of Contents macro occurs only after the page is saved.