1 Date: Mon, 29 Jun 2015 12:04:28 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.5.4)
3 Content-Type: application/x-phpwiki;
4 pagename=Help%2FMediawikiTablePlugin;
5 flags=PAGE_LOCKED%2CEXTERNAL_PAGE;
7 Content-Transfer-Encoding: binary
9 The **~MediawikiTable** [[Help:WikiPlugin|plugin]] allows a user to specify a ##<table>## with (a subset of) the syntax used by Mediawiki.
10 The plugin is not meant to be called directly, just use the syntax below to insert your table.
12 == Mediawiki table syntax ==
14 * The table starts with a line ##{|##.
15 * An optional table caption is made with a line starting with a pipe and a plus sign ##|+## followed by the caption.
16 * A table row starts with a pipe and a hyphen: ##|-##.
17 * A table cell starts with a pipe on a new line, or a double bar ##||## on the same line.
18 * A header table cell starts with an exclamation mark, or a double exclamation mark ##!!## on the same line.
19 * The table ends with a line ##|}##.
21 If the first row of the table as made with header cells only, this row will be put in a //thead//.
22 In that case, this row will be repeated on every page when printing the table.
24 === HTML attributes ===
32 | {{{ {| border="1" }}}
35 | {{{ |+ style="font-weight: bold;" }}}
38 | {{{ |- style="height:100px" }}}
41 | {{{ | align="right" | Cell 2 (right aligned) }}}
44 The attributes might be put with or without double quotes.
46 === Predefined CSS classes ===
48 If you do not specify a class for the table, it will be rendered without border.
50 ==== Boxed and bordered tables ====
52 If you specify ##class="boxed"##, you will have a border around the table (but not around the cells).
54 If you specify ##class="bordered"##, you will have a border around the table and the cells
56 In both cases, the caption (if any) will be bold and centered under the table
58 In both cases, the headers (specified by ##!##) will have a ##"#d8d8d8"## background
60 ==== Sortable tables ====
62 If you specify ##class="sortable"##, the table columns will be sortable.
63 An icon will be put in the headers to show the table is sortable.
64 Clicking on a column header will sort that column.
65 You can sort multiple columns with shift click.
67 ==== Do not break table when printing ====
69 If you specify ##class="nobreak"##, the table will not be cut when printed (if your browser supports it).
73 === Example 1: simple table ===
75 {| border="1" style="width: 100%"
76 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
77 |- style="white-space: nowrap"
83 | **Cell II**, in bold
84 |align=right width="100%" |Cell III
85 |- bgcolor=#f0f0ff align=center
86 |Cell 1||Cell 2||Cell 3
89 The above table is rendered from:
92 {| border="1" style="width: 100%"
93 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
94 |- style="white-space: nowrap"
100 | **Cell II**, in bold
101 |align=right width="100%" |Cell III
102 |- bgcolor=#f0f0ff align=center
103 |Cell 1||Cell 2||Cell 3
107 === Example 2: table with paragraphs, lists and plugins in cells ===
110 |- style="white-space: nowrap"
121 |- bgcolor=#f0f0ff align=center
122 |Current date || <<CurrentTime format=date>>
125 The above table is rendered from:
129 |- style="white-space: nowrap"
140 |- bgcolor=#f0f0ff align=center
141 |Current date || <<CurrentTime format=date>>
145 === Example 3: sortable table ===
147 Click on a column header to sort the column.
148 Clicking a second time will reverse the sorting order.
150 {| class="bordered sortable"
152 ! First name !! Name !! Age
154 | John || Smith || 35
156 | Albert || Wells || 5
161 The above table is rendered from:
164 {| class="bordered sortable"
166 ! First name !! Name !! Age
168 | John || Smith || 35
170 | Albert || Wells || 5
176 === Example 4: nested tables ===
179 {| class="bordered" align=center
180 |+ Outer table caption
182 ! Header A !! Header B
189 This cell contains a nested table.
191 |+ Inner table caption
214 The above table is rendered from:
218 {| class="bordered" align=center
219 |+ Outer table caption
221 ! Header A !! Header B
228 This cell contains a nested table.
230 |+ Inner table caption
255 * Marc-Etienne Vargenau, Alcatel-Lucent
258 * [[http://meta.wikimedia.org/wiki/Help:Table|Mediawiki table help page]]
262 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]