1 Date: Tue, 9 Nov 2010 14:24:02 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0)
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 * An optional table summary is made with a line starting with a pipe and an equal sign ##|=## followed by the summary.
17 * A table row starts with a pipe and a hyphen: ##|-##.
18 * A table cell starts with a pipe on a new line, or a double bar ##||## on the same line.
19 * A header table cell starts with an exclamation mark, or a double exclamation mark ##!!## on the same line.
20 * The table ends with a line ##|}##.
22 The summary syntax is an extension to the Mediawiki syntax.
23 You can also simply put the summary as an attribute to the table.
24 The summary is necessary to be able to create accessible tables.
26 If the first row of the table as made with header cells only, this row will be put in a //thead//.
27 In that case, this row will be repeated on every page when printing the table.
29 === HTML attributes ===
37 | {{{ {| border="1" }}}
40 | {{{ |+ style="font-weight: bold;" }}}
43 | {{{ |- style="height:100px" }}}
46 | {{{ | align="right" | Cell 2 (right aligned) }}}
49 The attributes might be put with or without double quotes.
51 === Predefined CSS classes ===
53 If you do not specify a class for the table, it will be rendered without border.
55 ==== Boxed and bordered tables ====
57 If you specify ##class="boxed"##, you will have a border around the table (but not around the cells).
59 If you specify ##class="bordered"##, you will have a border around the table and the cells
61 In both cases, the caption (if any) will be bold and centered under the table
63 In both cases, the headers (specified by ##!##) will have a ##"#d8d8d8"## background
65 ==== Sortable tables ====
67 If you specify ##class="sortable"##, the table columns will be sortable.
69 ==== Do not break table when printing ====
71 If you specify ##class="nobreak"##, the table will not be cut when printed (if your browser supports it).
75 === Example 1: simple table ===
77 {| border="1" style="width: 100%"
78 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
79 |= This is the table summary
80 |- style="white-space: nowrap"
86 | **Cell II**, in bold
87 |align=right width="100%" |Cell III
88 |- bgcolor=#f0f0ff align=center
89 |Cell 1||Cell 2||Cell 3
92 The above table is rendered from:
95 {| border="1" style="width: 100%"
96 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
97 |= This is the table summary
98 |- style="white-space: nowrap"
102 |- style=height:100px
104 | **Cell II**, in bold
105 |align=right width="100%" |Cell III
106 |- bgcolor=#f0f0ff align=center
107 |Cell 1||Cell 2||Cell 3
111 === Example 2: table with paragraphs, lists and plugins in cells ===
114 |- style="white-space: nowrap"
125 |- bgcolor=#f0f0ff align=center
126 |Current date || <<CurrentTime format=date>>
129 The above table is rendered from:
133 |- style="white-space: nowrap"
144 |- bgcolor=#f0f0ff align=center
145 |Current date || <<CurrentTime format=date>>
149 === Example 3: sortable table ===
151 Click on a column header to sort the column.
152 Clicking a second time will reverse the sorting order.
154 {| class="bordered sortable"
156 ! First name !! Name !! Age
158 | John || Smith || 35
160 | Albert || Wells || 5
165 The above table is rendered from:
168 {| class="bordered sortable"
170 ! First name !! Name !! Age
172 | John || Smith || 35
174 | Albert || Wells || 5
180 === Example 4: nested tables ===
183 {| class="bordered" align=center
184 |+ Outer table caption
186 ! Header A !! Header B
193 This cell contains a nested table.
195 |+ Inner table caption
218 The above table is rendered from:
222 {| class="bordered" align=center
223 |+ Outer table caption
225 ! Header A !! Header B
232 This cell contains a nested table.
234 |+ Inner table caption
259 * Marc-Etienne Vargenau, Alcatel-Lucent
262 * [[http://meta.wikimedia.org/wiki/Help:Table|Mediawiki table help page]]
266 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]