1 Date: Tue, 25 Aug 2009 20:32:21 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124)
4 Content-Type: application/x-phpwiki;
5 pagename=Help%2FMediawikiTablePlugin;
6 flags=PAGE_LOCKED%2CEXTERNAL_PAGE;
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 ##{|##.
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.
22 * The table ends with a line ##|}##.
24 The summary syntax is an extension to the Mediawiki syntax.
25 You can also simply put the summary as an attribute to the table.
26 The summary is necessary to be able to create accessible tables.
36 | {{{ {| border="1" }}}
39 | {{{ |+ style="font-weight: bold;" }}}
42 | {{{ |- style="height:100px" }}}
45 | {{{ | align="right" | Cell 2 (right aligned) }}}
48 The attributes might be put with or without double quotes.
50 === Predefined CSS classes
52 If you do not specify a class for the table, it will be rendered without border.
54 ==== Boxed and bordered tables
56 If you specify ##class="boxed"##, you will have a border around the table (but not around the cells).
58 If you specify ##class="bordered"##, you will have a border around the table and the cells
60 In both cases, the caption (if any) will be bold and centered under the table
62 In both cases, the headers (specified by ##!##) will have a ##"#d8d8d8"## background
66 If you specify ##class="sortable"##, the table columns will be sortable.
68 ==== Do not break table when printing
70 If you specify ##class="nobreak"##, the table will not be cut when printed (if your browser supports it).
74 === Example 1: simple table
76 {| border="1" style="width: 100%"
77 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
78 |= This is the table summary
79 |- style="white-space: nowrap"
85 | **Cell II**, in bold
86 |align=right, width="100%" |Cell III
87 |- bgcolor=#f0f0ff, align=center
88 |Cell 1||Cell 2||Cell 3
91 The above table is rendered from:
94 {| border="1" style="width: 100%"
95 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
96 |= This is the table summary
97 |- style="white-space: nowrap"
101 |- style=height:100px
103 | **Cell II**, in bold
104 |align=right, width="100%" |Cell III
105 |- bgcolor=#f0f0ff, align=center
106 |Cell 1||Cell 2||Cell 3
110 === Example 2: table with paragraphs, lists and plugins in cells
113 |- style="white-space: nowrap"
124 |- bgcolor=#f0f0ff, align=center
125 |Current date || <<CurrentTime format=date>>
128 The above table is rendered from:
132 |- style="white-space: nowrap"
143 |- bgcolor=#f0f0ff, align=center
144 |Current date || <<CurrentTime format=date>>
148 === Example 3: sortable table
150 Click on a column header to sort the column.
151 Clicking a second time will reverse the sorting order.
153 {| class="bordered sortable"
155 ! First name !! Name !! Age
157 | John || Smith || 35
159 | Albert || Wells || 5
164 The above table is rendered from:
167 {| class="bordered sortable"
169 ! First name !! Name !! Age
171 | John || Smith || 35
173 | Albert || Wells || 5
179 === Example 4: nested tables
182 {| class="bordered" align=center
183 |+ Outer table caption
185 ! Header A !! Header B
192 This cell contains a nested table.
194 |+ Inner table caption
217 The above table is rendered from:
221 {| class="bordered" align=center
222 |+ Outer table caption
224 ! Header A !! Header B
231 This cell contains a nested table.
233 |+ Inner table caption
259 Marc-Etienne Vargenau, Alcatel-Lucent
262 * [[http://meta.wikimedia.org/wiki/Help:Table|Mediawiki table help page]]
266 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]