1 Date: Thu, 26 Mar 2009 11:34:32 +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 ##{|## and ends with a line ##|}##.
17 * An optional table caption is made with a line starting with a pipe and a plus sign ##|+## followed by the caption.
18 * An optional table summary is made with a line starting with a pipe and an equal sign ##|=## followed by the summary.
19 * A table row starts with a pipe and a hyphen: ##|-##.
20 * A table cell starts with a pipe on a new line, or a double bar ##||## on the same line.
21 * A header table cell starts with an exclamation mark, or a double exclamation mark ##!!## 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.
35 | {{{ {| border="1" }}}
38 | {{{ |+ style="font-weight: bold;" }}}
41 | {{{ |- style="height:100px" }}}
44 | {{{ | align="right" | Cell 2 (right aligned) }}}
47 The attributes might be put with or without double quotes.
49 === Predefined CSS classes
51 If you do not specify a class for the table, it will be rendered without border.
53 ==== Boxed and bordered tables
55 If you specify ##class="boxed"##, you will have a border around the table (but not around the cells).
57 If you specify ##class="bordered"##, you will have a border around the table and the cells
59 In both cases, the caption (if any) will be bold and centered under the table
61 In both cases, the headers (specified by ##!##) will have a ##"#d8d8d8"## background
65 If you specify ##class="sortable"##, the table columns will be sortable.
69 === Example 1: simple table
71 {| border="1" style="width: 100%"
72 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
73 |= This is the table summary
74 |- style="white-space: nowrap"
80 | **Cell II**, in bold
81 |align=right, width="100%" |Cell III
82 |- bgcolor=#f0f0ff, align=center
83 |Cell 1||Cell 2||Cell 3
86 The above table is rendered from:
89 {| border="1" style="width: 100%"
90 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
91 |= This is the table summary
92 |- style="white-space: nowrap"
98 | **Cell II**, in bold
99 |align=right, width="100%" |Cell III
100 |- bgcolor=#f0f0ff, align=center
101 |Cell 1||Cell 2||Cell 3
105 === Example 2: table with paragraphs, lists and plugins in cells
108 |- style="white-space: nowrap"
119 |- bgcolor=#f0f0ff, align=center
120 |Current date || <<CurrentTime format=date>>
123 The above table is rendered from:
127 |- style="white-space: nowrap"
138 |- bgcolor=#f0f0ff, align=center
139 |Current date || <<CurrentTime format=date>>
143 === Example 3: sortable table
145 Click on a column header to sort the column.
146 Clicking a second time will reverse the sorting order.
148 {| class="bordered sortable"
150 ! First name !! Name !! Age
152 | John || Smith || 35
154 | Albert || Wells || 5
159 The above table is rendered from:
162 {| class="bordered sortable"
164 ! First name !! Name !! Age
166 | John || Smith || 35
168 | Albert || Wells || 5
174 === Example 4: nested tables
177 {| class="bordered" align=center
178 |+ Outer table caption
180 ! Header A !! Header B
187 This cell contains a nested table.
189 |+ Inner table caption
212 The above table is rendered from:
216 {| class="bordered" align=center
217 |+ Outer table caption
219 ! Header A !! Header B
226 This cell contains a nested table.
228 |+ Inner table caption
254 Marc-Etienne Vargenau, Alcatel-Lucent
257 * [[http://meta.wikimedia.org/wiki/Help:Table|Mediawiki table help page]]
261 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]