Help:Section

Pages can be divided into different sections by using headings. This helps to keep the page organized and uncluttered by sorting information into different labelled parts of the page. A page that contains four or more headings will automatically generate a table of contents that allows readers to quickly jump to a specific section.

Creating sections
Sections can be created by adding headings using the following syntax.

{| style="width:100%;" !scope="col" style="width:50%;"| You type !scope="col" style="width:50%;"| You get
 * style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"| = Heading 1 =
 * style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"| = Heading 1 =

Heading 6

 * style="width:50%; background:#f9f9f9; border-width:1px;border-style:solid none none solid;border-color:#ddd; padding:9px 5px 5px; vertical-align:top;"|


 * style="width:50%; border-width:1px;border-style:solid none none none;border-color:#ddd; padding:5px; vertical-align:top;"|
 * style="width:50%; border-width:1px;border-style:solid none none none;border-color:#ddd; padding:5px; vertical-align:top;"|
 * }
 * }

Do not use Level 1 headings as they are used in page titles. Section headings should usually follow a hierarchy, starting from a Level 2 heading and then gradually working their way down to lower heading levels for sub-sections.

Table of contents
A table of contents, or TOC, is automatically generated when a page contains four or more headings. The table of contents is displayed just below the last paragraph of the very first part of the page, typically called the intro or "lede", or at the top of the page if there is no text in the intro. The table of contents will list all of the section headings on the page, numbered in sequential order, and will allow users to quickly jump to those sections when clicked. A table of contents is invaluable for navigation on a very long page.

The remainder of this section will describe different ways in which editors can manipulate and control the table of contents.

Hiding the table of contents
In rare circumstances it may be desirable to hide the table of contents on a page (such as for a template). This can be accomplished by adding the  magic word anywhere on the page, usually in the spot where the table of contents would normally appear. This prevents the table of contents from appearing on the current page, even if there are more than three headings. It is not necessary to use this magic word if there are less than four headings, and should typically not be used if the page cannot fit on one screen.

You can also achieve the opposite effect and force the table of contents to appear even if there are less than four headings by using the  magic word.

Positioning the table of contents
By default, the table of contents appears just below the last line of the intro, or lede, of the page. You can specify where exactly the table of contents should appear by using the  magic word where you want the table of contents to appear. This can be used to fix alignment or layout issues on certain pages, such as the table of contents appearing too low on the page. However, this should be used with caution; adding text after the table of contents but before the first heading can cause issues with accessibility.

Using  will force the table of contents to appear even if there are less than four headings on the page. The main difference between it and  is that   causes the table of contents to appear where the magic word was inserted, while   causes the table of contents to appear in its usual location.

Section linking
Every heading, regardless of whether or not a table of contents exists on the page, produces an HTML "anchor" that can be linked to. When editing pages on, you can create a link to a section by typing. For example, to link to this section, type. When linking to this section from other sites, the URL would be. You can link to a section on the current page by simply typing, without first having to enter the name of the page.

When a reader visits the link, they will be taken to the page in question and automatically brought to the linked section in question. If the linked section does not exist, the reader will still be taken to the page as normal, but will not be redirected to any particular section of the page.

If you add a heading to the page that contains only blank spaces, the heading will appear in the table of contents, but clicking on it will not take readers to the intended section. You should generally avoid creating headings with no content in them as this is generally bad form.

Linking to the table of contents
The table of contents has a section name of toc, so you can link to it by typing  or.

Creating a linkable section without using headings
Sometimes, it may be desirable to create an anchor that you can link to without using a section heading, such as for tables where section headings cannot be used. On, this can be accomplished by using the Anchor template. Simply add where you want the target to point to. For example, if you add to the page, you can link to it using.

Sections created by Anchor do not appear in the table of contents, and will not affect the display of the page.

Section editing
Each section, by default, will produce an "Edit" link adjacent to it that allows editors to edit only that section. When clicked, the editing window will only display the contents of that section and any applicable sub-sections. Section editing is useful on very long pages and can help reduce the likelihood of an edit conflict occurring.

When editing sections using this method, the edit summary field will be prefilled with. These are automatically rendered as section links when you publish your edit. For example,  would be rendered as:

test - &rarr;Foo: test

In cases where it may be necessary to disable these section edit links, you can add  anywhere on the page to disable the links. It will not disable section editing itself; anyone can still edit sections if they know the exact URL to do so, or by editing the entire page.

New section link
All talk pages will have an additional  link next to the  button that allows them to quickly add a new section onto the bottom of the page. In this case, the edit summary box will be replaced with a '' box that will be used in the Level 2 heading of the section. If this box is left empty, no new heading will be created. This is commonly used on discussion pages to create new discussion threads.

The '' link is disabled by default on other pages, although it can be enabled by adding  anywhere on the page. It is also possible to disable the link by adding  anywhere on the page.

Preview
When you preview an edit while editing a section, you may not see the section as it actually appears on the full page. For example, if there is an image in the previous section that intrudes into the section you are editing, you will not see this image. The list of templates used on the page will show the list of all templates used on the page, not just the ones in the edited section. Additionally, if you are editing the "References" section of a page, which would contain  or  which would normally display all of the footnotes used on the page, footnotes used in previous sections will not be displayed.

If you preview a section that contains footnotes but does not contain  or, those footnotes will still be previewed normally at the bottom of the preview window. In previous versions of MediaWiki, the footnotes would not be displayed and a cite error message would be displayed instead.

Subsections
Subsections are included in the part of the section that is edited. For example, if you click on the "Edit" link next to a Level 2 heading, you will be able to edit everything under that heading, including lower-level headings, up until the next Level 2 heading on the page.