ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Template:Toc: Difference between revisions

From ModEnc
Jump to navigation Jump to search
anything else?
 
Make a better one
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{|align="right"
<includeonly><div style="float:{{{1|left}}}; {{#switch:{{{1|left}}}|right=clear: right; |center=clear: both; |left={{#if:{{{2|}}}|clear: {{{2}}}; }}}}margin: {{#switch:{{{1|left}}}|center=0 auto|right=.5em 0 .8em 1.4em|.5em 1.4em .8em 0}}; background:transparent; max-width:20em;">__TOC__</div></includeonly><noinclude>
|__TOC__
{{Doc|notoc=1}}</noinclude>
|}
<noinclude>Usage:
<pre>{{Tocright}}</pre>
Copy-paste the code above and put it at the height of the page where you want the top of the TOC appear, floating on the right. Note that usage of [[Template:Clr]] might become necessary, as with all floats.</noinclude>

Latest revision as of 08:24, 23 August 2021

Template Documentation  [View] [Edit] [History] [Help] [Refresh]

This template will specify the catalogue of the page and make it float (that is, the text can surround the catalogue), specify the location of the catalogue, or make it have no text around on the left / right side.

Parameters descriptions

Parameters Default values Optional values Descriptions
1 left left, right, center The first parameter, for specifying the location of the catalogue. Please do not use center in general.
2 (NULL) (Only if the value of parameter 1 is left)
  • right (Only if the value of parameter 1 is right)
  • both (Only if the value of parameter 1 is center)
right (Only if the value of parameter 1 is left)
  • No options (Only if the value of parameter 1 is center or left)
The second parameter, use for specifying which side of the catalogue to empty, which will make that side have no text around the catalogue. Only while the catalogue is left, you will have option right to clear the text on the right. In other cases, the side to be cleared will be automatically specified and cannot be customized.

Examples

Use {{Toc}} or {{Toc|left}}

Use {{Toc|center}}

Use {{Toc|right}}