• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Horizontal TOC/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Horizontal TOC

Contents

  • 1 Usage
  • 2 Limitations
  • 3 See also
This is the template sandbox page for Template:Horizontal TOC (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 6,900 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
CSSThis template uses TemplateStyles:
  • Template:TOC limit/styles.css (sandbox)
  • Template:Horizontal TOC/styles.css (sandbox)
  • Template:Horizontal TOC/horizontal-toc-no-parentheses.css
This template does not work properly in the Vector 2022 skin. Read the documentation for an explanation.

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

Usage

edit
{{horizontal TOC}}

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

  • See example

To hide the generated heading numbers, use:

{{horizontal TOC|nonum=yes}}
  • See example

To suppress the parentheses around subsection lists, use:

{{horizontal TOC|noparens=yes}}

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

{{horizontal TOC|limit=2}}
  • See example

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

{{horizontal TOC|align=center}}
  • See example

For country and state lists with flag icons, see these examples: Legality of cannabis by country. And: Legality of cannabis by U.S. jurisdiction.

Limitations

edit

Since the Vector 2022 skin forces the table of contents into a sidebar or a pop-up menu, this template does not control the placement of the TOC in that skin. {{Compact TOC}} is usually a viable substitute; it may need customization, which is explained in its documentation.

See also

edit
  • Help:Table of contents
  • {{Compact TOC}}
  • {{List TOC letters}}
  • {{Nonumtoc}}
  • {{flatlist}} - see example in the map caption. This method will also work with id= as described here: Help:Tables and locations#Section link or map link to a row anchor.

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

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
No numbersnonum

Hide the generated heading numbers

Example
yes
Stringoptional
Limitlimit

Limits the depth of subheadings shown. For instance using limit=4 will hide the fourth level and deeper subheadings in the hierarchy. And limit=2 will hide all subheadings leaving only the main headings. This works by hiding the lower levels with CSS

Numberoptional
No parenthesisno_parenthesis noparens

Separates entries by bullets, regardless of sub-sections.

Example
yes
Stringoptional
Alignalign

Which side of the page to align the ToC to. Allowed values are left, right, center

Suggested values
left center right
Example
align=left
Stringoptional
Clearclear

Align underneath floating images and tables or not. Allowed values are left, right, both, none

Suggested values
left right both none
Example
clear:both
Stringoptional
Linkslinks

Specify a list of links for the table of contents instead of the section links automatically generated by the TOC magic word

Example
* [[#Season 1|1]]
Stringoptional
The above documentation is transcluded from Template:Horizontal TOC/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Horizontal_TOC/sandbox&oldid=1297669731"
Last edited on 27 June 2025, at 18:34

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 27 June 2025, at 18:34 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop