]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - pgsrc/Help%2FMediawikiTablePlugin
Produced by PhpWiki 1.4.0RC-20100415
[SourceForge/phpwiki.git] / pgsrc / Help%2FMediawikiTablePlugin
1 Date: Thu, 15 Apr 2010 16:32:58 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415)
3 X-Rcs-Id: $Id$
4 Content-Type: application/x-phpwiki;
5   pagename=Help%2FMediawikiTablePlugin;
6   flags=PAGE_LOCKED%2CEXTERNAL_PAGE;
7   markup=2;
8   charset=UTF-8
9 Content-Transfer-Encoding: binary
10
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.
13
14 == Mediawiki table syntax
15
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 ##|}##.
23
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.
27
28 === HTML attributes
29
30 {| class="bordered"
31 |-
32 ! Attribute
33 ! Syntax
34 |-
35 | For the table
36 | {{{ {| border="1" }}}
37 |-
38 | For the caption
39 | {{{ |+ style="font-weight: bold;" }}}
40 |-
41 | For a row
42 | {{{ |- style="height:100px" }}}
43 |-
44 | For a cell
45 | {{{ | align="right" | Cell 2 (right aligned) }}}
46 |}
47
48 The attributes might be put with or without double quotes.
49
50 === Predefined CSS classes
51
52 If you do not specify a class for the table, it will be rendered without border.
53
54 ==== Boxed and bordered tables
55
56 If you specify ##class="boxed"##, you will have a border around the table (but not around the cells).
57
58 If you specify ##class="bordered"##, you will have a border around the table and the cells
59
60 In both cases, the caption (if any) will be bold and centered under the table
61
62 In both cases, the headers (specified by ##!##) will have a ##"#d8d8d8"## background
63
64 ==== Sortable tables
65
66 If you specify ##class="sortable"##, the table columns will be sortable.
67
68 ==== Do not break table when printing
69
70 If you specify ##class="nobreak"##, the table will not be cut when printed (if your browser supports it).
71
72 == Examples
73
74 === Example 1: simple table
75
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"
80 ! Header 1
81 ! Header 2
82 ! Header 3
83 |- style=height:100px
84 | Cell I
85 | **Cell II**,  in bold
86 |align=right, width="100%" |Cell III
87 |- bgcolor=#f0f0ff, align=center
88 |Cell 1||Cell 2||Cell 3
89 |}
90
91 The above table is rendered from:
92
93 {{{
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"
98 ! Header 1
99 ! Header 2
100 ! Header 3
101 |- style=height:100px
102 | Cell I
103 | **Cell II**,  in bold
104 |align=right, width="100%" |Cell III
105 |- bgcolor=#f0f0ff, align=center
106 |Cell 1||Cell 2||Cell 3
107 |}
108 }}}
109
110 === Example 2: table with paragraphs, lists and plugins in cells
111
112 {|
113 |- style="white-space: nowrap"
114 ! Header 1
115 ! Header 2
116 |- bgcolor=yellow
117 | First paragraph.
118
119 Second paragraph.
120 |
121 * One
122 * Two
123 * Three
124 |- bgcolor=#f0f0ff, align=center
125 |Current date || <<CurrentTime format=date>>
126 |}
127
128 The above table is rendered from:
129
130 {{{
131 {|
132 |- style="white-space: nowrap"
133 ! Header 1
134 ! Header 2
135 |- bgcolor=yellow
136 | First paragraph.
137
138 Second paragraph.
139 |
140 * One
141 * Two
142 * Three
143 |- bgcolor=#f0f0ff, align=center
144 |Current date || <<CurrentTime format=date>>
145 |}
146 }}}
147
148 === Example 3: sortable table
149
150 Click on a column header to sort the column.
151 Clicking a second time will reverse the sorting order.
152
153 {| class="bordered sortable"
154 |-
155 ! First name !! Name !! Age
156 |-
157 | John || Smith || 35
158 |-
159 | Albert || Wells || 5
160 |-
161 | Sam || Adam || 102
162 |}
163
164 The above table is rendered from:
165
166 {{{
167 {| class="bordered sortable"
168 |-
169 ! First name !! Name !! Age
170 |-
171 | John || Smith || 35
172 |-
173 | Albert || Wells || 5
174 |-
175 | Sam || Adam || 102
176 |}
177 }}}
178
179 === Example 4: nested tables
180
181 <<MediawikiTable
182 {| class="bordered" align=center
183 |+ Outer table caption
184 |-
185 ! Header A !! Header B
186 |-
187 | A numbered list:
188 # one
189 # two
190 # three
191 |
192 This cell contains a nested table.
193  {| class="bordered"
194  |+ Inner table caption
195  |-
196  ! Header A
197  ! Header B
198  |-
199  | Inner A1
200  | Inner B1
201  |-
202  | Inner A2
203  | Inner B2
204  |}
205 |-
206 | A paragraph
207
208 Another paragraph
209
210 | A plain list:
211 * apple
212 * pear
213 * apricot
214 |}
215 >>
216
217 The above table is rendered from:
218
219 {{{
220 <<MediawikiTable
221 {| class="bordered" align=center
222 |+ Outer table caption
223 |-
224 ! Header A !! Header B
225 |-
226 | A numbered list:
227 # one
228 # two
229 # three
230 |
231 This cell contains a nested table.
232  {| class="bordered"
233  |+ Inner table caption
234  |-
235  ! Header A
236  ! Header B
237  |-
238  | Inner A1
239  | Inner B1
240  |-
241  | Inner A2
242  | Inner B2
243  |}
244 |-
245 | A paragraph
246
247 Another paragraph
248
249 | A plain list:
250 * apple
251 * pear
252 * apricot
253 |}
254 >>
255 }}}
256
257 == Author
258
259 Marc-Etienne Vargenau, Alcatel-Lucent
260
261 == See Also
262 * [[http://meta.wikimedia.org/wiki/Help:Table|Mediawiki table help page]]
263
264 <noinclude>
265 ----
266 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]
267 </noinclude>