Manuale:Tabella dei contenuti

Jump to navigation Jump to search
This page is a translated version of the page Manual:Table of contents and the translation is 29% complete.
Outdated translations are marked like this.
Other languages:
Deutsch • ‎English • ‎Esperanto • ‎español • ‎italiano • ‎polski • ‎português do Brasil • ‎русский • ‎中文 • ‎日本語
This page is about tables of contents in wiki pages. For the contents page of the MediaWiki technical manual, see Manual:Contents.

By default, a table of contents (sometimes abbreviated to TOC) is automatically generated on a page when more than three section headings are used.

Tipicamente, la tavola riproduce e numera questi titoli.

Tutta HTML negli encabezados sta desnudado nel TOC, tranne ‎<sup>, ‎<sub>, ‎<i>, <span dir="rtl">, <span dir="ltr">.

The table of contents is not generated for section headings that are found within html tags (Manual:$wgRawHtml ).

Nascondendo il TOC

Place __NOTOC__ anywhere you want on the page to hide its TOC.

Using certain templates, such as Template:Compact ToC (found on English Wikipedia), will replace the regular Table of Contents functionality.

Collocando il TOC

La posizione predefinita della TOC è direttamente sopra l'intestazione della prima sezione. Qualsiasi testo previo è collocato prima della TOC. Any prior text is placed before the TOC. Per collocarlo in un altro luogo, usa la parola magica __TOC__ nella posizione preferita nella pagina.

Una skin può togliere o spostare la tabella dei contenuti a un'altra sezione della pagina che utilizza Extension:DeToc .

Aggiungendo il TOC

If you have three or fewer headings but want to have a TOC, write either the magic word __FORCETOC__ anywhere on the page to make it display at the default location, or __TOC__ at the preferred position.

Personalizando Il TOC


Attenzione Attenzione: This seems to be available in some Wikimedia-projects only, like w:template:TOC left.

An extenuating circumstance may require the width of a TOC width to be adjusted as a percentage of a page. For example: {{TOC left|width=30%}}


The maximum level of headings displayed on the TOC is defined in $wgMaxTocLevel . To customize this for individual pages, the TOC can be enclosed in an element with class toclimit-<limit>, if the appropriate CSS rules are defined in the pages CSS.

See Template:TOC and the relevant rules at MediaWiki:Gadget-site.css for an example implementation.


By default, the TOC automatically numbers the sections. The section headings themselves aren't numbered. This behavior of the table of contents can be customised in several ways:

  • It is possible to suppress the auto-generated section numbers in the TOC, if the proper class exists locally at MediaWiki:Common.css, defined as .tocnumber { display: none; }.

To do this selectively, a wrapper element can be placed around the TOC, as in <div class="noautonum">__TOC__</div> on the page, and .noautonum .tocnumber { display: none; } at MediaWiki:Common.css.

  • There is a user preference to also auto-number the section headings, at Preferences > Appearance > Advanced options > Auto-number headings. This can be set globally for the whole wiki by defining $wgDefaultUserOptions ['numberheadings'] = 1; in LocalSettings.php
    • This setting can be overridden individually by users, by changing their preferences as described above, or by setting .mw-headline-number { display: none; } in their user style page. Administrators who lack server access can also override the setting for all users, if it is activated as mentioned above. This is done by using the same CSS code in the site's global common.css file.
  • To add a period to the automatically generated numbering do as described:


Different languages have different ways of expressing TOCs and how its (sub)section numbering is done. Also, the different style guides of many languages differ in what style of TOC and TOC (sub)section numbering scheme they recommend for writers to use.

The different w:style guides of each language sometimes recommend different typographic conventions to follow.

It's important to note that most languages don't even have any style guide for writing in that language (and many languages don't have a written form entirely), so people usually use the most common style based on existing written convention (not prescribed, but simply 'standard' due to popular usage), which makes the written use of many languages have a sort of 'fluid' punctuation, spelling/orthography and even [personal changes of the very] grammar [of that particular language]. w:Westernization has influenced alphabet and non-alphabet writing systems, with many languages simply copying or being artificially converted to European-style typographic and w:punctuational conventions.

An example on how to change the style of a TOC to a localized one is given below:

Some languages put a dot after a (sub)section ordinal number, e.g. they do not use the following TOC style:

1 Section [1]
1.1 Subsection [1.1]
2 Section [2]
2.1 Subsection [2.1]
3 Section [3]
3.1 Subsection [3.1]
3.1.1 Subsubsection [3.1.1]
3.1.2 Subsubsection [3.1.2]

But use one like so:

1. Section [1.]
1.1. Subsection [1.1.]
2. Section [2.]
2.1. Subsection [2.1.]
3. Section [3.]
3.1. Subsection [3.1.]
3.1.1. Subsubsection [3.1.1.]
3.1.2. Subsubsection [3.1.2.]

(Notice the addition of dots after ordinal numerals before the section names!)

It's possible to produce that effect using w:CSS. Put the following CSS code in a shared CSS file of your MediaWiki installation and it should work:

.tocnumber:after { content: '.' }

where the symbol between the single quotation marks is the sign after a (sub)section number.

Vedere anche bugzilla:43494 e bugzilla:33450 per i dettagli relazionati con i18n problemi della TOC.


The TOC can be made to display as a floating element on the page, with text flowing around it.

For this, enclose the TOC in an element with the CSS style float:left; or float:right;.

Vedere Template:TOC per una implementazione di esempio.


The behavior of the table of contents can be further adjusted using extensions.

Vedere Category:TOC extensions per l'elenco.

Collegamenti esterni