1 Date: Tue, 9 Nov 2010 14:24:02 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC1)
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.
28 If the first row of the table as made with header cells only, this row will be put in a //thead//.
29 In that case, this row will be repeated on every page when printing the table.
31 === HTML attributes ===
39 | {{{ {| border="1" }}}
42 | {{{ |+ style="font-weight: bold;" }}}
45 | {{{ |- style="height:100px" }}}
48 | {{{ | align="right" | Cell 2 (right aligned) }}}
51 The attributes might be put with or without double quotes.
53 === Predefined CSS classes ===
55 If you do not specify a class for the table, it will be rendered without border.
57 ==== Boxed and bordered tables ====
59 If you specify ##class="boxed"##, you will have a border around the table (but not around the cells).
61 If you specify ##class="bordered"##, you will have a border around the table and the cells
63 In both cases, the caption (if any) will be bold and centered under the table
65 In both cases, the headers (specified by ##!##) will have a ##"#d8d8d8"## background
67 ==== Sortable tables ====
69 If you specify ##class="sortable"##, the table columns will be sortable.
71 ==== Do not break table when printing ====
73 If you specify ##class="nobreak"##, the table will not be cut when printed (if your browser supports it).
77 === Example 1: simple table ===
79 {| border="1" style="width: 100%"
80 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
81 |= This is the table summary
82 |- style="white-space: nowrap"
88 | **Cell II**, in bold
89 |align=right width="100%" |Cell III
90 |- bgcolor=#f0f0ff align=center
91 |Cell 1||Cell 2||Cell 3
94 The above table is rendered from:
97 {| border="1" style="width: 100%"
98 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
99 |= This is the table summary
100 |- style="white-space: nowrap"
104 |- style=height:100px
106 | **Cell II**, in bold
107 |align=right width="100%" |Cell III
108 |- bgcolor=#f0f0ff align=center
109 |Cell 1||Cell 2||Cell 3
113 === Example 2: table with paragraphs, lists and plugins in cells ===
116 |- style="white-space: nowrap"
127 |- bgcolor=#f0f0ff align=center
128 |Current date || <<CurrentTime format=date>>
131 The above table is rendered from:
135 |- style="white-space: nowrap"
146 |- bgcolor=#f0f0ff align=center
147 |Current date || <<CurrentTime format=date>>
151 === Example 3: sortable table ===
153 Click on a column header to sort the column.
154 Clicking a second time will reverse the sorting order.
156 {| class="bordered sortable"
158 ! First name !! Name !! Age
160 | John || Smith || 35
162 | Albert || Wells || 5
167 The above table is rendered from:
170 {| class="bordered sortable"
172 ! First name !! Name !! Age
174 | John || Smith || 35
176 | Albert || Wells || 5
182 === Example 4: nested tables ===
185 {| class="bordered" align=center
186 |+ Outer table caption
188 ! Header A !! Header B
195 This cell contains a nested table.
197 |+ Inner table caption
220 The above table is rendered from:
224 {| class="bordered" align=center
225 |+ Outer table caption
227 ! Header A !! Header B
234 This cell contains a nested table.
236 |+ Inner table caption
261 * Marc-Etienne Vargenau, Alcatel-Lucent
264 * [[http://meta.wikimedia.org/wiki/Help:Table|Mediawiki table help page]]
268 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]