PathfinderWiki
Log in

Template:TOC/doc

From PathfinderWiki

The {{TOC}} template allows you to customize the placement, appearance, and behavior of a table of contents (TOC) within an article. You do not need to use this template to show a table of contents on a page with more than three second-level headings as it appears automatically, nor do you need to use this template to force a standard TOC to appear at a specific point in the article (use the __TOC__ magic word) or prevent it from appearing (__NOTOC__).

MediaWiki logo.svg

This page uses content from MediaWiki.org. The original article was at Template:TOC. The list of authors can be seen in the page history. The text of MediaWiki.org is available under the Creative Commons Attribution-ShareAlike License.

Usage

{{TOC
| clear =
| align = 
| width = 
| class = 
| style = 
}}

Parameters

All parameters are optional, and the default values mimic the normal TOC behavior. Using {{TOC}} by itself should result in the same behavior as using the __TOC__ magic word.

clear
Sets the TOC's CSS clear attribute. The default value is none.
align
Sets the TOC's CSS float attribute. The default value is none. Valid values are none, left, and right.
width
Sets the TOC's CSS width attribute. The default value is auto.
class
Sets the TOC's CSS class. The default value omits the class attribute from the <div> tag that this parameter wraps around the TOC.
style
Adds additional inline CSS styles to the wrapping <div> tag. No styles are added by default.

Modifying the TOC

This template makes it easy to customize the TOC in flexible ways.

Wrap article text around the TOC

Set the float attribute to left or right to move the TOC and wrap the article's text around it. This is the equivalent of templates like {{TOC left}}.

Change the TOC's width

By default, the TOC is as wide as the text within it. You can manually set the TOC's width by using the width parameter. For instance, a width value of 50% will cause the TOC to take up half the width of the article body.

Choose which heading levels the TOC displays

By default, the TOC displays headings up to three levels deep (headings wrapped in four equals signs, such as ==== Heading ====). You can limit this by applying a toclimit CSS class.

For example:

{{TOC
| class = toclimit-2
}}

limits the TOC to two levels.