Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Help:Section
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Positioning the TOC === When either <code><nowiki>__FORCETOC__</nowiki></code> or <code><nowiki>__TOC__</nowiki></code> (with two underscores on either side of the word) is placed in the wikitext, a TOC is generated even if the page has fewer than four headings. Using <code><nowiki>__FORCETOC__</nowiki></code> places the TOC immediately before the first section heading. Using <code><nowiki>__TOC__</nowiki></code> places the TOC at the same position as this code. Most articles have introductory text before the TOC, known as the "lead section". Although usually a section heading should immediately follow the TOC, using <code><nowiki>__TOC__</nowiki></code> can prevent you from being forced to insert a meaningless heading just to position the TOC correctly (i.e. not too low). However, if there is any text at all between the TOC and the first heading, this will cause problems with accessibility. ==== Floating the TOC ==== The TOC can, in some instances, be [[Cascading Style Sheets#Float and clear|floated]] either right or left using {{tlx|TOC right}} or {{tlx|TOC left}} when it is beneficial to the layout of the article, or when the default TOC gets in the way of other elements. Before changing the default TOC to a floated TOC, consider the following guidelines: # If floating the TOC, it should be placed at the end of the lead section of the text, before the first section heading. Users of [[screen reader]]s do not expect any text between the TOC and the first heading, and having no text above the TOC is confusing. ''See the last line in the information about [[Wikipedia:Manual of Style/Lead section#Elements|elements of the lead section]].'' # When floating a TOC, check whether the page layout will be harmed if the TOC is hidden by the user. # Long lists may create very long TOCs. The TOC should not be longer than necessary, whether it is floated or not. {{tlx|TOC limit}} can be used to reduce the length of the TOC by hiding nested subsections, rather than a floating TOC. # The default TOC is placed before the first headline, but after any introductory text. If the introductory summary is long enough that a typical user has to scroll down to see the top of the TOC, you may float the TOC, so it appears closer to the top of the article. However, the floating TOC should in most cases follow at least the first paragraph of article text. # Floating a wide TOC will produce a narrow column of readable text for users with low resolutions. If the TOC's width exceeds 30% of the user's visible screen (about twice the size of the Wikipedia navigation bar to the left), then it is not suitable for floating. (Percentages assume a typical user setup.) If text is trapped between a floating TOC and an image, floating can be cancelled at a certain text point, see [[Wikipedia:Picture tutorial#Forcing a break|Forcing a break]]. # If the TOC is placed in the general vicinity of other floated images or boxes, it can be floated as long as the flowing text column does not become narrower than 30% of the average user's visible screen width. # A left-floated TOC may affect bulleted or numbered lists. [[Template:TOC right]] was proposed for deletion in early July 2005, but there was no consensus on the matter. The archive of the discussion and voting regarding this may be seen at [[Wikipedia:Templates for deletion/TOCright]]. The Manual of Style discussion can be found [[Wikipedia talk:Manual of Style/Archive 17|here]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)