1 Date: Sun, 22 Feb 2009 19:16:30 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124)
4 Content-Type: application/x-phpwiki;
5 pagename=Help%2FMediawikiTablePlugin;
9 Content-Transfer-Encoding: binary
11 The *~MediawikiTable* [[Help:WikiPlugin|plugin]] allows a user to specify a ##<table>## with (a subset of) the syntax used by Mediawiki.
12 The plugin is not meant to be called directly, just use the syntax below to insert your table.
14 == Mediawiki table syntax
16 * The table starts with a line <b>{~|</b> and ends with a line <b>|~}</b>.
17 * An optional table caption is made with a line starting with a pipe and a plus sign <b>|+</b> followed by the caption.
18 * An optional table summary is made with a line starting with a pipe and an equal sign <b>|=</b> followed by the summary.
19 * A table row starts with a pipe and a hyphen: <b>|-</b>.
20 * A table cell starts with a pipe on a new line, or a double bar <b>||</b> on the same line.
21 * A header table cell starts with an exclamation mark, or a double exclamation mark <b>!!</b> on the same line.
23 The summary syntax is an extension to the Mediawiki syntax.
24 You can also simply put the summary as an attribute to the table.
25 The summary is necessary to be able to create accessible tables.
31 - style="font-weight:bold;background-color:#d8d8d8;", align=center
45 ~|+ style="font-weight: bold;"
50 ~|- style="height:100px"
55 ~| align="right" | Cell 2 (right aligned)
58 The attributes might be put with or without double quotes.
60 === Predefined CSS classes
62 If you do not specify a class for the table, it will be rendered without border.
64 ==== Boxed and bordered tables
66 If you specify ##class="boxed"##, you will have a border around the table (but not around the cells).
68 If you specify ##class="bordered"##, you will have a border around the table and the cells
70 In both cases, the caption (if any) will be bold and centered under the table
72 In both cases, the headers (specified by ##!##) will have a ##"#d8d8d8"## background
76 If you specify ##class="sortable"##, the table columns will be sortable.
80 === Example 1: simple table
82 {| border="1", style="width: 100%"
83 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
84 |= This is the table summary
85 |- style="white-space: nowrap"
91 | <b>Cell II</b>, in bold
92 |align=right, width="100%" |Cell III
93 |- bgcolor=#f0f0ff, align=center
94 |Cell 1||Cell 2||Cell 3
97 The above table is rendered from:
100 {| border="1", style="width: 100%"
101 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
102 |= This is the table summary
103 |- style="white-space: nowrap"
107 |- style=height:100px
109 | <b>Cell II</b>, in bold
110 |align=right, width="100%" |Cell III
111 |- bgcolor=#f0f0ff, align=center
112 |Cell 1||Cell 2||Cell 3
116 === Example 2: table with paragraphs, lists and plugins in cells
119 |- style="white-space: nowrap"
130 |- bgcolor=#f0f0ff, align=center
131 |Current date || <<CurrentTime format=date>>
134 The above table is rendered from:
138 |- style="white-space: nowrap"
149 |- bgcolor=#f0f0ff, align=center
150 |Current date || <<CurrentTime format=date>>
154 === Example 3: sortable table
156 Click on a column header to sort the column.
157 Clicking a second time will reverse the sorting order.
159 {| class="bordered sortable"
161 ! First name !! Name !! Age
163 | John || Smith || 35
165 | Albert || Wells || 5
170 The above table is rendered from:
173 {| class="bordered sortable"
175 ! First name !! Name !! Age
177 | John || Smith || 35
179 | Albert || Wells || 5
185 === Example 4: nested tables
188 {| class="bordered", align=center
189 |+ Outer table caption
191 ! Header A !! Header B
198 This cell contains a nested table.
200 |+ Inner table caption
223 The above table is rendered from:
227 {| class="bordered", align=center
228 |+ Outer table caption
230 ! Header A !! Header B
237 This cell contains a nested table.
239 |+ Inner table caption
265 Marc-Etienne Vargenau, Alcatel-Lucent
268 * [[http://meta.wikimedia.org/wiki/Help:Table|Mediawiki table help page]]
272 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]