GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing www.mediawiki.org — Help:Lists - MediaWiki
This page deals with creating lists in MediaWiki. List basicsMediaWiki offers three types of lists: unordered lists, ordered lists and definition lists. Basically
A little bit furtherIn the following table you will find some examples for both methods:
Multiple line in listsFor 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 noticeable effects. Paragraphs can be forced in lists by using HTML tags.
If you want to put more than one line of text, add two line break symbols, Continuing a list item after a sub-itemMediaWiki does not support continuing a list item after a sub-list, unless the whole list is marked up with HTML. WorkaroundsIn 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:
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:
See also m:Template:List demo. Changing the list typePer listThe list type (which type of marker appears before the list item) can be changed in CSS by setting the list-style-type property:
Site-wideThe standard #, ##, ### wikitext can be used alongside CSS in MediaWiki:Common.css to produce the usual system of numbered lists (1, 2, 3; then a, b, c; then i, ii, iii): ol { list-style-type: decimal; } ol li > ol { list-style-type: lower-alpha; } ol li > ol li > ol { list-style-type: lower-roman; } The first
Extra indentation of listsIn 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 colons: for each colon). This can be done with CSS: ol { margin-left: 2cm} or alternatively, like below.
Specifying a starting valueSpecifying a starting value is possible with HTML syntax.
Or:
Comparison with a tableApart from providing automatic numbering, the numbered list also aligns the contents of the items, comparable with using table syntax: {|
|-
| align=right | 9.|| Amsterdam
|-
| align=right | 10.|| Rotterdam
|-
| align=right | 11.|| The Hague
|}
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 listsSee also Template:Col-begin, Template:Col-break, Template:Col-end. Multi-column bulleted list<div style="column-count:2"> * apple * carpet * geography * mountain * nowhere * postage * ragged * toast </div> gives:
<div style="column-count:3"> * apple * carpet * geography * mountain * nowhere * postage * ragged * toast </div> gives:
Multi-column numbered list<div style="column-count:3"> # apple # carpet # geography # mountain # nowhere # postage # ragged # toast </div> gives:
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: {| valign="top"
|-
|<ul><ol start="125"><li>a</li><li>bb</li><li>ccc</li></ol></ul>
|<ul><ol start="128"><li>ddd</li><li>ee</li><li>f</li></ol></ul>
|}
gives
Using m:Template:multi-column numbered list 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. {{Multi-column numbered list|125|a<li>bb<li>ccc|3|<li>ddd<li>ee<li>f}}
gives:
{{Multi-column numbered list|lst=lower-alpha|125|a<li>bb<li>ccc|3|<li>ddd<li>ee|2|<li>f}}
gives:
{{Multi-column numbered list|lst=lower-roman|125|a<li>bb<li>ccc|3|<li>ddd<li>ee|2|<li>f}}
gives:
{{Multi-column numbered list|lst=disc||a<li>bb<li>ccc||<li>ddd<li>ee||<li>f}}
gives:
Streamlined style or horizontal styleIt 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. TablesA 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 onesWith 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:
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 also 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. See also
Retrieved from "https://www.mediawiki.org/w/index.php?title=Help:Lists&oldid=8216454" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||