== List basics ==
CodexWiki offers three types of lists. '''Ordered lists''', '''unordered lists''', and '''definition lists'''. In the following sections, ordered lists are used for examples. Unordered lists would give corresponding results.
{|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
|}
== Paragraphs in lists ==
For simplicity, list items in wiki markup cannot be longer than a paragraph. A following blank line will end the list and reset the counter on ordered lists. Separating unordered list items usually has no noticable effects.
Paragraphs can be forced in lists by using HTML tags. Two line break symbols, ..., will create the desired effect. So will enclosing all but the first paragraph with
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;"
|
continuing list item A1
#list item A1 ##list item B1 ###list item C1 ##:continuing list item B1 ##list item B2 #list item A2gives #list item A1 ##list item B1 ###list item C1 ##:continuing list item B1 ##list item B2 #list item A2 See also [[Help:Section#Subdivisions in general|subdivisions]]. == Changing the list type == The list type (which type of marker appears before the list item) can be changed in CSS by setting the [http://www.w3.org/TR/REC-CSS2/generate.html#lists list-style-type] property: {|border=1 width="79%" !wikitext!!rendering |- |
style="margin-left: 2em", causing indentation of the contents. This is '''the most versatile method''', as it allows starting with a number other than 1, see below.
|-
|
start and value 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.)
gives
- Amsterdam
- Rotterdam
- The Hague
gives
- Amsterdam
- Rotterdam
- The Hague
{|
|-
| align=right | 9.||Amsterdam
|-
| align=right | 10.||Rotterdam
|-
| align=right | 11.||The Hague
|}
gives
{|
|-
| align=right | 9.||Amsterdam
|-
| align=right | 10.||Rotterdam
|-
| align=right | 11.||The Hague
|}
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 bulleted list==
{|
|
*1
*2
|
*3
*4
|}
gives:
{|
|
*1
*2
|
*3
*4
|}
==Multi-column numbered list==
Specifying a starting value is useful for a numbered list with multiple columns, to avoid restarting from one in each column. As mentioned above, 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:
{| valign="top"
|-
|{{Multi-column numbered list|125|a{{Multi-column numbered list|lst=lower-alpha|125|a{{Multi-column numbered list|lst=lower-roman|125|a{{Multi-column numbered list|lst=disc||a