Manual:Table of contents

By default, a table of contents (sometimes abbreviated to TOC) is automatically generated on a page when more than three section headings are used. Typically, the table reproduces and numbers these headings.

Hiding the TOC

 * See also Manual:FAQ


 * For one page
 * Place the magic word  into the page markup.


 * For all pages
 * There are three ways to achieve this:
 * Install Extension:NoTOC
 * Add the following rule to MediaWiki:Common.css:  (overridable per user through their user css pages)
 * Define  in LocalSettings.php (overridable per user through their preferences)


 * Per user
 * Users can individually opt to have the table of contents hidden. This is a user preference, set in Special:Preferences (Preferences > Appearance > Advanced options > Show table of contents).

Positioning the TOC
The default position of the TOC is directly above the first section heading. Any prior text is placed before the TOC. To place it elsewhere, use the magic word  at the preferred position on the page.

Adding the TOC
If you have less than three headings but want to add a TOC, write either the magic word  anywhere on the page to make it display at the default location, or   at the preferred position.

Depth
The maximum level of headings displayed on the TOC is defined in. To customize this for individual pages, the TOC can be enclosed in an element with class. See Template:TOC for an example implementation.

Auto-numbering
By default, the TOC is automatically numbers the sections. The section headings themselves aren't numbered. This behavior of the table of contents can be customised in several ways:


 * It is possible to suppress the auto-generated section numbers, if the proper class exists locally at MediaWiki:Common.css, defined as.
 * There is a user preference to also auto-number the section headings, at Preferences > Appearance > Advanced options > Auto-number headings. This can be set globally for the whole wiki by defining  in LocalSettings.php (users can override this setting by changing their preferences)

Floating
The TOC can be made to display as a floating element on the page, with text flowing around it. For this, enclose the TOC in an element with the CSS style  or. See Template:TOC for an example implementation.

Extensions
The behaviour of the table of contents can be further adjusted using extensions. See Category:TOC extensions for a list.