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