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