Jump to content

Template:Horizontal TOC/doc: Difference between revisions

From pool
[checked revision][checked revision]
Content deleted Content added
m Text replacement - "[[WP:" to "[[Wikipedia:WP:"
 
Line 5: Line 5:
{{Uses TemplateStyles|Template:TOC limit/styles.css|Template:Horizontal TOC/styles.css|Template:Horizontal TOC/horizontal-toc-no-parentheses.css|noprotcat=yes}}
{{Uses TemplateStyles|Template:TOC limit/styles.css|Template:Horizontal TOC/styles.css|Template:Horizontal TOC/horizontal-toc-no-parentheses.css|noprotcat=yes}}


This template lays out the table of contents in a [[WP:HLIST|horizontal list]] rather than a vertical one.
This template lays out the table of contents in a [[Wikipedia:WP:HLIST|horizontal list]] rather than a vertical one.


== Usage ==
== Usage ==

Latest revision as of 08:13, 21 October 2020


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

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

{{horizontal TOC|align=center}}

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

For example,

{{horizontal TOC}}

produces:

See also

See wikipedia for more detail: wikipedia:Template:Horizontal TOC

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

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

Example
align=left
Stringoptional
Clearclear

Align underneath floating images and tables or not. Allowed values are 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