Difference between revisions of "Help:Contents"
(→Tables) |
(→Tables) |
||
| Line 298: | Line 298: | ||
By clicking on the buttons in the cell headers, the entries can be sorted by the value in that column, in either ascending or descending order. | By clicking on the buttons in the cell headers, the entries can be sorted by the value in that column, in either ascending or descending order. | ||
| + | |||
| + | == Citations and references == | ||
Revision as of 19:30, 21 November 2018
Contents
MediaWiki syntax
| Description | You type | You get |
| Applies anywhere | ||
| Italicise text |
''italic'' |
italic |
| Bold text |
'''bold''' |
bold |
| Bold and italic |
'''''bold & italic''''' |
bold & italic |
| Internal link (within the wiki) |
[[name of page]] |
|
| Link to section in another page |
[[Another page#Some heading]] |
|
| Link to a section in this page |
[[#Some heading]] |
|
| Redirect to another page |
#redirect [[Target page]] |
Going to that page automatically bounces you to the specified other page. |
| External link (to other websites) |
[http://www.example.org] |
|
| Applies only at the beginning of the line | ||
| Headings of different sizes |
==level 1== |
Level 1Level 2Level 3Level 4 |
| Bullet list |
* one |
|
| Numbered list |
# one |
|
| Thumbnail image |
[[Image:Wiki.png|thumb|Caption text]] |
File:Wiki.png Caption text |
Indented text
If you start a line with a colon (:), it is indented. Two colons mean double-indented.
e.g. a line like this:
: Hello world.
Gives you text like this:
- Hello world.
Key-value lists
This:
; Chestnut: The most common colour of horse. ; Dapple grey: Another colour for horses.
Gives you this:
- Chestnut
- The most common colour of horse.
- Dapple grey
- Another colour for horses.
Tables
See also http://en.wikipedia.org/wiki/Help:Table
Basic table
Here is a table:
| Fruit | Colour |
| Banana | Yellow |
| Apple | Green |
| Tomato | Red |
And here is the code for it:
{| border="1" cellpadding="4"
| '''Fruit''' || '''Colour'''
|-
| '''Banana''' || Yellow
|-
| '''Apple''' || Green
|-
| '''Tomato''' || Red
|}
Alternative syntax for basic table
Or alternatively, you can do it like this (each cell on its own line):
{| border="1" cellpadding="4"
| '''Fruit'''
| '''Colour'''
|-
| '''Banana'''
| Yellow
|-
| '''Apple'''
| Green
|-
| '''Tomato'''
| Red
|}
Colspans
You can do things like colspan:
| Fruits | ||
| Banana | Yellow | |
| Apple | Green | |
| Tomato | Red | |
Here's the code for it:
{| border="1" cellpadding="4"
| colspan="3" align="center" | '''Fruits'''
|-
| '''Banana''' || Yellow
|-
| '''Apple''' || Green
|-
| '''Tomato''' || Red
|}
Cell colors
| Fruit | Colour |
| Banana | Yellow |
| Apple | Green |
| Tomato | Red |
And here is the code for it:
{| border="1" cellpadding="4"
| '''Fruit''' || '''Colour'''
|-
| '''Banana''' || style="background: #ffff00;" | Yellow
|-
| '''Apple''' || style="background: #00FF00;" | Green
|-
| '''Tomato''' || style="background: red;" | Red
|}
Sortable table
When a list of entries is included in a table on a page, you can use JavaScript to make the table 'sortable' (it is not possible to force a table to be sorted by a default order on page load). To do this, add the "sortable" class to the table declaration and make sure you defined headers using exclamations marks:
{| class="wikitable sortable"
|-
! Fruit !! Price
|-
| Apples || £0.95
|-
| Oranges || £0.85
|-
| Pears || £1.15
|-
| Purple mangosteen || £1.05
|}
Which produces the following output:
| Fruit | Price |
|---|---|
| Apples | £0.95 |
| Oranges | £0.85 |
| Pears | £1.15 |
| Purple mangosteen | £1.05 |
By clicking on the buttons in the cell headers, the entries can be sorted by the value in that column, in either ascending or descending order.