Help:Lists/de

Diese Seite erläutert die Erstellung von Listen in MediaWiki.

Listen Grundlagen
bietet drei Arten von Listen an: geordnete Listen, ungeordnete Listen, und Definitionslisten. In folgenden Abschnitten werden geordnete Listen als Beispiele verwendet. Ungeordnete Listen ergeben vergleichbare Resultate.

Absätze in Listen
Listenelemente in Wiki Markup können der Einfachheit halber nicht länger als ein Absatz sein. Eine folgende Leerzeile beendet die Liste und setzt den Zähler geordneter Listen zurück. Die Trennung ungeordneter Listenelemente hat normal keine erkennbaren Effekte.

Listenabsätze können mit HTML Tags erzwungen werden. Zwei Zeilenumbruchsymbole,, erzeugen den gewünschten Effekt. Alle Absätze bis auf den ersten mit  einzuschließen erzielt dasselbe.

Zur Klarheit kann es nötig sein, eine Leerzeile zwischen Listenelementen zu setzen, die länger als ein Absatz sind.

Ein Listenelement nach einem Unterpunkt fortsetzen
In HTML kann ein Listenelement mehrere unabhängige Unterlisten enthalten. Daher können Teile des Listenelements nicht nur vor der ersten, sondern auch zwischen folgenden Unterlisten und nach der letzten sein. In der Wiki-Syntax folgen die Unterlisten jedoch den gleichen Regeln wie Seitenabschnitte: Der einzig mögliche nicht in Unterlisten enthaltene Teil des Listenelements befindet sich vor der ersten Unterliste.

Bei einer unnummerierten Liste erster Ebene in Wikitext-Code kann diese Einschränkung durch Aufteilen in mehrere Listen überwunden werden; eingerückter Text zwischen den Teillisten kann visuell als Teil eines Listenelements nach einer Unterliste dienen. Dies kann, abhängig von CSS, eine Leerzeile vor und nach jeder Liste ergeben. In diesem Fall könnte zur Vereinheitlichung jedes Listenelement erster Ebene zu einer separaten Liste gemacht werden.

Numbered lists illustrate that what should look like one list may, for the software, consist of multiple lists; unnumbered lists give a corresponding result, except that the problem of restarting with 1 is not applicable.

One level deeper, with a sublist item continuing after a sub-sublist, one gets even more blank lines; however, the continuation of the first-level list is not affected:

gives
 * 1) list item A1
 * 2) list item B1
 * 3) list item C1
 * continuing list item B1
 * 1) list item B2
 * 2) list item A2
 * 1) list item A1
 * 2) list item B1
 * 3) list item C1
 * continuing list item B1
 * 1) list item B2
 * 2) list item A2

See also.

Changing the list type
The list type (which type of marker appears before the list item) can be changed in CSS by setting the list-style-type property:

Extra indentation of lists
In a numbered list in a large font, some browsers do not show more than two digits, unless extra indentation is applied (if there are multiple columns: for each column). This can be done with CSS: ol { margin-left: 2cm} or alternatively, like below.

To demonstrate that all three methods show all digits of 3-digit numbers, see List demo.

Specifying a starting value
Specifying a starting value is possible with HTML syntax. (W3C has deprecated the  and   attributes as used below in HTML 4.01 and XHTML 1.0. But as of 2007, no popular web browsers implement CSS counters, which were to replace these attributes. Wikimedia projects use XHTML Transitional, which contains the deprecated attributes.)

Or:

Comparison with a table
Apart from providing automatic numbering, the numbered list also aligns the contents of the items, comparable with using table syntax:

gives

This non-automatic numbering has the advantage that if a text refers to the numbers, insertion or deletion of an item does not disturb the correspondence.

Multi-column lists
See also Template:Col-begin, Template:Col-break, Template:Col-end.

Multi-column bulleted list

 * apple
 * carpet
 * geography
 * mountain
 * nowhere
 * postage
 * ragged
 * toast

gives:


 * apple
 * carpet
 * geography
 * mountain
 * nowhere
 * postage
 * ragged
 * toast


 * apple
 * carpet
 * geography
 * mountain
 * nowhere
 * postage
 * ragged
 * toast

gives:


 * apple
 * carpet
 * geography
 * mountain
 * nowhere
 * postage
 * ragged
 * toast

Multi-column numbered list

 * 1) apple
 * 2) carpet
 * 3) geography
 * 4) mountain
 * 5) nowhere
 * 6) postage
 * 7) ragged
 * 8) toast

gives:


 * 1) apple
 * 2) carpet
 * 3) geography
 * 4) mountain
 * 5) nowhere
 * 6) postage
 * 7) ragged
 * 8) toast

Below a starting value is specified, with HTML-syntax (for the first column either wiki-syntax or HTML-syntax can be used).

In combination with the extra indentation explained in the previous section:

gives

Using the computation of the starting values can be automated, and only the first starting value and the number of items in each column except the last has to be specified. Adding an item to, or removing an item from a column requires adjusting only one number, the number of items in that column, instead of changing the starting numbers for all subsequent columns.

gives:

gives:

gives:

gives:

Streamlined style or horizontal style
It is also possible to present short lists using very basic formatting, such as:

Title of list: example 1, example 2, example 3

Title of list: example 1, example 2, example 3

This style requires less space on the page, and is preferred if there are only a few entries in the list, it can be read easily, and a direct edit point is not required. The list items should start with a lowercase letter unless they are proper nouns.

Tables
A one-column table is very similar to a list, but it allows sorting. If the wikitext itself is already sorted with the same sortkey, this advantage does not apply. A multiple-column table allows sorting on any column.

See also When to use tables.

Changing unordered lists to ordered ones
With the CSS ul { list-style: decimal } unordered lists are changed to ordered ones. This applies (as far as the CSS selector does not restrict this) to all ul-lists in the HTML source code:


 * those produced with *
 * those with  in the wikitext
 * those produced by the system

Since each special page, like other pages, has a class based on the pagename, one can separately specify for each type whether the lists should be ordered, see User contributions and What links here.

However, it does not seem possible to make all page history lists ordered (unless one makes all lists ordered), because the class name is based on the page for which the history is viewed.