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

Template:Horizontal TOC

  • Template
  • Talk
  • Language
  • Watch
  • View source
(Redirected from Template:Horizontal toc)

Contents

  • 1 Usage
  • 2 Limitations
  • 3 See also
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

{{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

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

  • 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&oldid=1129333165"
Last edited on 24 December 2022, at 19:49

Languages

    • العربية
    • Авар
    • Azərbaycanca
    • تۆرکجه
    • Basa Bali
    • বাংলা
    • 閩南語 / Bân-lâm-gí
    • भोजपुरी
    • Български
    • Буряад
    • Català
    • डोटेली
    • Eesti
    • Ελληνικά
    • فارسی
    • Føroyskt
    • Gaeilge
    • Galego
    • 한국어
    • Ilokano
    • Bahasa Indonesia
    • ქართული
    • Kurdî
    • Ladin
    • Lietuvių
    • മലയാളം
    • Bahasa Melayu
    • မြန်မာဘာသာ
    • 日本語
    • ਪੰਜਾਬੀ
    • پښتو
    • Português
    • Română
    • Русский
    • Shqip
    • සිංහල
    • Simple English
    • سنڌي
    • Slovenščina
    • کوردی
    • Српски / srpski
    • Srpskohrvatski / српскохрватски
    • తెలుగు
    • Тоҷикӣ
    • Türkçe
    • Українська
    • اردو
    • Tiếng Việt
    • 中文
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 24 December 2022, at 19:49 (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