Difference between revisions of "Template:Horizontal TOC/doc"

From DMARC Wiki
Jump to navigation Jump to search
(Example 4)
m (20 revisions imported)
 
(2 intermediate revisions by 2 users not shown)
Line 10: Line 10:
 
</pre>
 
</pre>
 
There is no need to specify <code><nowiki>__NOTOC__</nowiki></code>: this template handles that automatically.
 
There is no need to specify <code><nowiki>__NOTOC__</nowiki></code>: this template handles that automatically.
 +
*[https://en.wikipedia.org/w/index.php?title=Template:Horizontal_TOC/doc&oldid=653960465 See example]
  
 
To hide the generated heading numbers, use:
 
To hide the generated heading numbers, use:
Line 16: Line 17:
 
{{horizontal TOC|nonum=yes}}
 
{{horizontal TOC|nonum=yes}}
 
</pre>
 
</pre>
 +
*[https://en.wikipedia.org/w/index.php?title=Template:Horizontal_TOC/doc&oldid=653960502 See example]
  
 
To limit the depth of the generated headings to the first headings only, use:
 
To limit the depth of the generated headings to the first headings only, use:
Line 22: Line 24:
 
{{horizontal TOC|limit=2}}
 
{{horizontal TOC|limit=2}}
 
</pre>
 
</pre>
 +
*[https://en.wikipedia.org/w/index.php?title=Template:Horizontal_TOC/doc&oldid=653960535 See example]
  
 
To float the table of contents to the center of the page, use:
 
To float the table of contents to the center of the page, use:
Line 28: Line 31:
 
{{horizontal TOC|align=center}}
 
{{horizontal TOC|align=center}}
 
</pre>
 
</pre>
{{horizontal TOC|align=center}}
+
*[https://en.wikipedia.org/w/index.php?title=Template:Horizontal_TOC/doc&oldid=653960585 See example]
 +
 
 +
For a country list with flag icons, see this example: [[Legality of cannabis by country]].
  
<!--Example headers to generate the example TOCs-->
 
==Example main header 1==
 
===Sub-header 1a===
 
====Sub-header 1b====
 
===Sub-header 2===
 
==Example main header 2==
 
 
<includeonly>
 
<includeonly>
 
<!-- Categories go here -->
 
<!-- Categories go here -->
 
[[Category:Wikipedia table of contents templates]]
 
[[Category:Wikipedia table of contents templates]]
 
</includeonly>
 
</includeonly>

Latest revision as of 02:36, 17 July 2015

Template:Mbox

This template lays out the table of contents in a horizontal list rather than a vertical one.

Usage

{{horizontal TOC}}

There is no need to specify __NOTOC__: this template handles that automatically.

To hide the generated heading numbers, use:

{{horizontal TOC|nonum=yes}}

To limit the depth of the generated headings to the first headings only, use:

{{horizontal TOC|limit=2}}

To float the table of contents to the center of the page, use:

{{horizontal TOC|align=center}}

For a country list with flag icons, see this example: Legality of cannabis by country.