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;
8 Content-Transfer-Encoding: binary
10 The **~MediawikiTable** [[Help:WikiPlugin|plugin]] allows a user to specify a ##<table>## with (a subset of) the syntax used by Mediawiki.
11 The plugin is not meant to be called directly, just use the syntax below to insert your table.
13 == Mediawiki table syntax ==
15 * The table starts with a line ##{|##.
16 * An optional table caption is made with a line starting with a pipe and a plus sign ##|+## followed by the caption.
17 * An optional table summary is made with a line starting with a pipe and an equal sign ##|=## followed by the summary.
18 * A table row starts with a pipe and a hyphen: ##|-##.
19 * A table cell starts with a pipe on a new line, or a double bar ##||## on the same line.
20 * A header table cell starts with an exclamation mark, or a double exclamation mark ##!!## on the same line.
21 * The table ends with a 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.
27 If the first row of the table as made with header cells only, this row will be put in a //thead//.
28 In that case, this row will be repeated on every page when printing the table.
30 === HTML attributes ===
38 | {{{ {| border="1" }}}
41 | {{{ |+ style="font-weight: bold;" }}}
44 | {{{ |- style="height:100px" }}}
47 | {{{ | align="right" | Cell 2 (right aligned) }}}
50 The attributes might be put with or without double quotes.
52 === Predefined CSS classes ===
54 If you do not specify a class for the table, it will be rendered without border.
56 ==== Boxed and bordered tables ====
58 If you specify ##class="boxed"##, you will have a border around the table (but not around the cells).
60 If you specify ##class="bordered"##, you will have a border around the table and the cells
62 In both cases, the caption (if any) will be bold and centered under the table
64 In both cases, the headers (specified by ##!##) will have a ##"#d8d8d8"## background
66 ==== Sortable tables ====
68 If you specify ##class="sortable"##, the table columns will be sortable.
70 ==== Do not break table when printing ====
72 If you specify ##class="nobreak"##, the table will not be cut when printed (if your browser supports it).
76 === Example 1: simple table ===
78 {| border="1" style="width: 100%"
79 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
80 |= This is the table summary
81 |- style="white-space: nowrap"
87 | **Cell II**, in bold
88 |align=right width="100%" |Cell III
89 |- bgcolor=#f0f0ff align=center
90 |Cell 1||Cell 2||Cell 3
93 The above table is rendered from:
96 {| border="1" style="width: 100%"
97 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
98 |= This is the table summary
99 |- style="white-space: nowrap"
103 |- style=height:100px
105 | **Cell II**, in bold
106 |align=right width="100%" |Cell III
107 |- bgcolor=#f0f0ff align=center
108 |Cell 1||Cell 2||Cell 3
112 === Example 2: table with paragraphs, lists and plugins in cells ===
115 |- style="white-space: nowrap"
126 |- bgcolor=#f0f0ff align=center
127 |Current date || <<CurrentTime format=date>>
130 The above table is rendered from:
134 |- style="white-space: nowrap"
145 |- bgcolor=#f0f0ff align=center
146 |Current date || <<CurrentTime format=date>>
150 === Example 3: sortable table ===
152 Click on a column header to sort the column.
153 Clicking a second time will reverse the sorting order.
155 {| class="bordered sortable"
157 ! First name !! Name !! Age
159 | John || Smith || 35
161 | Albert || Wells || 5
166 The above table is rendered from:
169 {| class="bordered sortable"
171 ! First name !! Name !! Age
173 | John || Smith || 35
175 | Albert || Wells || 5
181 === Example 4: nested tables ===
184 {| class="bordered" align=center
185 |+ Outer table caption
187 ! Header A !! Header B
194 This cell contains a nested table.
196 |+ Inner table caption
219 The above table is rendered from:
223 {| class="bordered" align=center
224 |+ Outer table caption
226 ! Header A !! Header B
233 This cell contains a nested table.
235 |+ Inner table caption
260 * Marc-Etienne Vargenau, Alcatel-Lucent
263 * [[http://meta.wikimedia.org/wiki/Help:Table|Mediawiki table help page]]
267 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]