Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:TOC: Difference between revisions

Template page
Arin Mara (talk | contribs)
mNo edit summary
Arin Mara (talk | contribs)
m Removed deletion banner after restoration
Line 1: Line 1:
<div style="clear: {{{clear|both}}}; margin-bottom: .5em; float: {{{align|none}}}; {{#ifeq: {{lc:{{{align|}}}}} | right | margin-left:2.5em; | {{#ifeq: {{lc:{{{align|}}}}} | left | margin-right:2.5em; | <!-- align=none --> }} }} width: {{{width|auto}}};" {{#if:{{{limit|}}}|class="toclimit-{{{limit|}}}"}}>__TOC__</div><noinclude>
<div style="{{#if:{{{clear|}}}{{{align|}}}| clear: {{{clear|both}}}; }} margin-bottom: .5em; float: {{{align|none}}}; {{#ifeq: {{lc:{{{align|}}}}} | right | margin-left:2em; | {{#ifeq: {{lc:{{{align|}}}}} | left | margin-right:2em; | <!-- align=none --> }} }} width: {{{width|auto}}};" {{#if:{{{limit|}}}|class="toclimit-{{{limit}}}"}}>__TOC__</div><noinclude>
{{Deletion|Lowering the bar: reduce the number of templates; rarely used template}}
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>

Revision as of 20:24, 12 August 2022

Template documentation (for the above template, sometimes hidden or invisible)
Description
This template changes the way the table of contents is rendered.
Dependencies
Uses
MediaWiki:Common.css
__TOC__
Syntax
{{TOC|<limit=>|<align=>}}
Parameters
limit
Number indicating the highest heading level to show in the table of contents. The lower, the fewer heading levels are shown. Note that in articles, the main level for headings starts at 2 (the article title is H1). Valid values 2 till 6. Defaults to no limit.
align
Whether to align the table of contents to the "right" or "left". The default is left.
Sample
{{TOC|limit= 3|align= right}}
gives... (Note: Due to the way this template, the documentation template and the table of contents code works the sample does not function when not looking directly on the doc page.)

section 1

section 1.1

section 1.1.1

section 1.1.1.1
See also
Visit Template:TOC/doc to edit this text! (How does this work?) (Refresh this text - why?)