Difference between revisions of "Template:TOC"
m (Added category) |
|||
(12 intermediate revisions by 2 users not shown) | |||
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> | + | <noinclude>{{Languages|nocat=1}}</noinclude><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> |
− | == | + | '''Tables of contents''' contain links to sections within an article, providing easy and automatic on-page navigation. |
− | + | ||
− | + | ==Standard Tables of Contents== | |
− | + | Articles will include a default table of contents when more than three section headings appear. The default table of contents will include all section headings and will appear just before the first section heading. By default, the table of contents will be left aligned. | |
+ | |||
+ | You may hide an individual table of contents when viewing an article by clicking the "hide" link in the table. | ||
+ | |||
+ | ==Modifying the Table of Contents== | ||
+ | Several [[mw:Help:Magic_words|magic words]] and templates exist which modify the standard tables of contents. | ||
+ | |||
+ | ===Removing the Table of Contents from an article=== | ||
+ | To remove the table of contents from any article, simply add the magic word <nowiki>__NOTOC__</nowiki> anywhere within the article. It's usually not advisable to do so, however. | ||
+ | |||
+ | ===Forcing and Moving the Table of Contents=== | ||
+ | To force the table of contents to appear regardless of how many headings an article has, simply add the magic word <nowiki>__TOC__</nowiki> anywhere within the article. The table of contents will appear wherever you place the template, allowing you to move it up or down the page from its normal position. | ||
+ | |||
+ | ===Changing the alignment of the table of contents=== | ||
+ | To force the table of contents to appear on the right of a page, use the <nowiki>{{tocright}}</nowiki> template. The table of contents will appear wherever you place the template. | ||
+ | |||
+ | To force the table of contents to float on the left of a page, use the <nowiki>{{tocleft}}</nowiki> template. The table of contents will appear wherever you place the template. Note that the text of the page will wrap around a floated table of contents, whereas the standard table does not allow text to appear to the right of the table and instead creates whitespace. | ||
+ | |||
+ | ==Disclaimer== | ||
+ | [[Template:TOC]], [[Template:TOCright]], and [[Template:TOCleft]] are available from [[mw:MediaWiki|MediaWiki]] under the [//creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike License]. | ||
+ | |||
+ | ==See also== | ||
+ | {{TOC see also}} | ||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> |
Latest revision as of 06:31, 16 April 2021
Language: | English |
---|
Tables of contents contain links to sections within an article, providing easy and automatic on-page navigation.
Standard Tables of Contents
Articles will include a default table of contents when more than three section headings appear. The default table of contents will include all section headings and will appear just before the first section heading. By default, the table of contents will be left aligned.
You may hide an individual table of contents when viewing an article by clicking the "hide" link in the table.
Modifying the Table of Contents
Several magic words and templates exist which modify the standard tables of contents.
Removing the Table of Contents from an article
To remove the table of contents from any article, simply add the magic word __NOTOC__ anywhere within the article. It's usually not advisable to do so, however.
Forcing and Moving the Table of Contents
To force the table of contents to appear regardless of how many headings an article has, simply add the magic word __TOC__ anywhere within the article. The table of contents will appear wherever you place the template, allowing you to move it up or down the page from its normal position.
Changing the alignment of the table of contents
To force the table of contents to appear on the right of a page, use the {{tocright}} template. The table of contents will appear wherever you place the template.
To force the table of contents to float on the left of a page, use the {{tocleft}} template. The table of contents will appear wherever you place the template. Note that the text of the page will wrap around a floated table of contents, whereas the standard table does not allow text to appear to the right of the table and instead creates whitespace.
Disclaimer
Template:TOC, Template:TOCright, and Template:TOCleft are available from MediaWiki under the Creative Commons Attribution-ShareAlike License.