Changes

Jump to: navigation, search

Help:List

5,850 bytes added, 15:59, 28 June 2006
no edit summary
{{H:h|editor toc}}
==List basics==
{|border=1 width="79%"
!wikitext!!rendering
|-
|
* Lists are easy to do:
** start every line
* with a star
** more stars mean
*** deeper levels
|
* Lists are easy to do:
** start every line
* with a star
** more stars mean
*** deeper levels
|-
|
*A newline
*in a list
marks the end of the list.
Of course
*you can
*start again.
|
*A newline
*in a list
marks the end of the list.
Of course
*you can
*start again.
|-
|
# Numbered lists are good
## very organized
## easy to follow
|
# Numbered lists are good
## very organized
## easy to follow
|-
|
* You can also
**break lines
**like this
|
* You can also
**break lines
**like this
|-
|
; Definition lists
; item : definition
; semicolon plus term
: colon plus definition
|
; Definition lists
; item : definition
; semicolon plus term
: colon plus definition
|-
|
* Or create mixed lists
*# and nest them
*#* like this
*#*; definitions
*#*: work:
*#*; apple
*#*; banana
*#*: fruits
|
* Or create mixed lists
*# and nest them
*#* like this
*#*; definitions
*#*: work:
*#*; apple
*#*; banana
*#*: fruits
|}{{-}}

==A blank line within a list item or between list items==

(In this and the next section, numbered lists are used in examples; unnumbered lists give a corresponding result. The only difference is the possible problem of a numbered list restarting with 1 if it is interrupted by a line that is not a list item.)

A list item can not be longer than one paragraph, unless HTML tags <nowiki><br><br></nowiki> or <nowiki><p>...</p></nowiki> are used within the list item to add space. A paragraph that does not begin with the same list item as preceding lines ("#" for a numbered list, "*" for an unnumbered list) will end the list. If the list is unnumbered, starting another paragraph with "*" will appear to continue the list, but if the list is numbered, the next paragraph which begins with "#" will start the list numbering over again from 1.

For a list with items of more than one paragraph long, adding a blank line between items may be necessary to avoid confusion.







==Continuing a list item after a sub-item==

In HTML, a list item may contain several sublists, not necessarily adjacent; thus there may be parts of the list item not only before the first sublist, but also between sublists, and after the last one; however, in wiki-syntax, sublists follow the same rules as sections of a page: the only possible part of the list item not in sublists is before the first sublist.

In the case of an unnumbered first-level list in wikitext code this limitation can be overcome by splitting the list into multiple lists; indented text between the partial lists may visually serve as part of a list item after a sublist; however, this may give, depending on CSS, a blank line before and after each list, in which case, for uniformity, every first-level list item could be made a separate list.

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.

{| style="border:1px;border-spacing:1px;background-color:black;" cellpadding="5"
|- style="background-color:white;"
|
<nowiki>
<ol>
<li>list item A1
<ol>
<li>list item B1</li>
<li>list item B2</li>
</ol>continuing list item A1
</li>
<li>list item A2</li>
</ol></nowiki>
| <ol>
<li>list item A1
<ol>
<li>list item B1</li>
<li>list item B2</li>
</ol>continuing list item A1
</li>
<li>list item A2</li>
</ol>
|- style="background-color:#E0E0E0;font-weight:bold;text-align:center;"
| colspan="2" | vs.
|- style="background-color:white;"
|
#list item A1
##list item B1
##list item B2
#:continuing list item A1
#list item A2
|
#list item A1
##list item B1
##list item B2
#:continuing list item A1
#list item A2
|}

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:
<pre>
#list item A1
##list item B1
###list item C1
##:continuing list item B1
##list item B2
#list item A2
</pre>
gives
#list item A1
##list item B1
###list item C1
##:continuing list item B1
##list item B2
#list item A2

See also {{tim|List demo}} and [[Help:Section#Subdivisions in general|subdivisions]].

==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).
<pre>
:#abc
:#def
:#ghi
</pre>

gives

:#abc
:#def
:#ghi

This doesn't work directly for XHTML &lt;ol&gt; lists instead of '''#''', for &lt;ul&gt; lists the Wiki markup '''*''' is more flexible.

==Multi-column numbered lists==
Specifying a starting value is useful for a numbered list with multiple columns, to avoid restarting from one in each column. This is only possible 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:
<pre>
{|
|<ol start="125"><li>a<li>bb<li>ccc</ol>
|<ol start="128"><li>ddd<li>ee<li>f</ol>
|}
</pre>
gives

{|
|<ol start="125"><li>a<li>bb<li>ccc</ol>
|<ol start="128"><li>ddd<li>ee<li>f</ol>
|}

==Numbered list across sections==
<!-- intentionally last section, confuses ToC -->
<pre>
:<h3>Example A</h3>
#abc
#def<h3>Example B</h3>
#ghi
#jkl
</pre>

gives

:<h3>Example A</h3>
#abc
#def<h3>Example B</h3>
#ghi
#jkl

However, this disturbs section numbering within and after the list: "sections" produced by the '''h3''' tag have an edit link (if enabled) and link to accordingly numbered sections, but application of "section =''n'' " is based on sections defined by = signs only.

{{h:f|enname=List}}
Anonymous user

Navigation menu