Difference between revisions of "Help:Tables"
Jump to navigation
Jump to search
m (+HelpEditing) |
m (Describe wikitable templates) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 68: | Line 68: | ||
Change the leading vertical bar character to an exclamation mark to change a cell into a heading. | Change the leading vertical bar character to an exclamation mark to change a cell into a heading. | ||
− | + | The pre-defined "wikitable" style makes the borders look a lot better. | |
{| | {| | ||
Line 74: | Line 74: | ||
| This input | | This input | ||
| | | | ||
− | + | <nowiki>{| class="wikitable"</nowiki> | |
− | |||
<nowiki>|-</nowiki> | <nowiki>|-</nowiki> | ||
<nowiki>!A</nowiki> | <nowiki>!A</nowiki> | ||
Line 98: | Line 97: | ||
|FFFF | |FFFF | ||
|} | |} | ||
+ | |} | ||
+ | |||
+ | The pre-defined "wikitable" template can also be used, but must be matched with a "endwikitable". | ||
+ | |||
+ | {| | ||
+ | |- | ||
+ | | This input | ||
+ | | | ||
+ | <nowiki>{{wikitable}}</nowiki> | ||
+ | <nowiki>|-</nowiki> | ||
+ | <nowiki>!A</nowiki> | ||
+ | <nowiki>!B</nowiki> | ||
+ | <nowiki>!C</nowiki> | ||
+ | <nowiki>|-</nowiki> | ||
+ | <nowiki>|DDDD</nowiki> | ||
+ | <nowiki>|EEEE</nowiki> | ||
+ | <nowiki>|FFFF</nowiki> | ||
+ | <nowiki>{{endwikitable}}</nowiki> | ||
+ | |||
+ | | '''also''' produces | ||
+ | | | ||
+ | {{wikitable}} | ||
+ | |- | ||
+ | !A | ||
+ | !B | ||
+ | !C | ||
+ | |- | ||
+ | |DDDD | ||
+ | |EEEE | ||
+ | |FFFF | ||
+ | {{endwikitable}} | ||
|} | |} | ||
==More== | ==More== | ||
− | + | {{HelpEditing}} | |
* http://en.wikipedia.org/wiki/Help:Table | * http://en.wikipedia.org/wiki/Help:Table | ||
* http://www.mediawiki.org/wiki/Help:Tables | * http://www.mediawiki.org/wiki/Help:Tables |
Latest revision as of 17:46, 23 November 2009
While it is possible to create table via raw HTML, the wiki allows a simpler style.
Tables start with a curly bracket and a vertical bar character (a pipe) "{|" and end with a pipe and curly bracket "|}".
To start a new table row, type a vertical bar and a hyphen on its own line: "|-".
Each cell in a row is on a new line which starts with just a vertical bar character.
This input |
{| |- |AAAA |BBBB |CCCC |- |DDDD |EEEE |FFFF |} |
produces |
|
There are lots of other options, but the simplest is to add borders.
This input |
{| border="1" |- |AAAA |BBBB |CCCC |- |DDDD |EEEE |FFFF |} |
produces |
|
Change the leading vertical bar character to an exclamation mark to change a cell into a heading. The pre-defined "wikitable" style makes the borders look a lot better.
This input |
{| class="wikitable" |- !A !B !C |- |DDDD |EEEE |FFFF |} |
produces |
|
The pre-defined "wikitable" template can also be used, but must be matched with a "endwikitable".
This input |
{{wikitable}} |- !A !B !C |- |DDDD |EEEE |FFFF {{endwikitable}} |
also produces |
|