]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - pgsrc/Help%2FMediawikiTablePlugin
Add summary syntax to Mediawiki tables
[SourceForge/phpwiki.git] / pgsrc / Help%2FMediawikiTablePlugin
1 Date: Mon, 22 Dec 2008 14:15:24 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124)
3 X-Rcs-Id: $Id$
4 Content-Type: application/x-phpwiki;
5   pagename=Help%2FMediawikiTablePlugin;
6   flags=PAGE_LOCKED;
7   markup=2;
8   charset=iso-8859-1
9 Content-Transfer-Encoding: binary
10
11 The *~MediawikiTable* [plugin|Help:WikiPlugin] takes off from the [RichTable|Help:RichTablePlugin] plugin. It allows a user to specify a <tt><table></tt> with (a subset of) the syntax used by Mediawiki.
12
13 * The table starts with a line <b>{~|</b> and ends with a line <b>|~}</b>.
14 * An optional table caption is made with a line starting with a pipe and a plus sign <b>|+</b> followed by the caption.
15 * An optional table summary is made with a line starting with a pipe and an equal sign <b>|=</b> followed by the summary.
16 * A table row starts with a pipe and a hyphen: <b>|-</b>.
17 * A table cell starts with a pipe on a new line, or a double bar <b>||</b> on the same line.
18 * A header table cell starts with an exclamation mark, or a double exclamation mark <b>!!</b> on the same line (works only with an explicit plugin call).
19
20 The summary syntax is an extension to the Mediawiki syntax. 
21 You can also simply put the summary as an attribute to the table.
22 The summary is necessary to be able to create accessible tables.
23
24 !!! HTML attributes
25
26 <?plugin RichTable
27 * class="bordered"
28 -
29 |
30 Attribute
31 |
32 Syntax
33 -
34 |
35 For the table
36 |
37 {| border="1"
38 -
39 |
40 For the caption
41 |
42 ~|+ style="font-weight: bold;"
43 -
44 |
45 For a row
46 |
47 ~|- style="height:100px"
48 -
49 |
50 For a cell
51 |
52 ~| align="right" | Cell 2 (right aligned)
53 ?>
54
55 The attributes might be put with or without double quotes.
56
57 !!! Example
58
59 {| border="1", style="width: 100%"
60 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
61 |= This is the table summary
62 |- style="white-space: nowrap"
63 | <b>Header 1</b>
64 | <b>Header 2</b>
65 | <b>Header 3</b>
66 |- style=height:100px
67 | Cell I
68 | <b>Cell II</b>,  in bold
69 |align=right, width="100%" |Cell III
70 |- bgcolor=#f0f0ff, align=center
71 |Cell 1||Cell 2||Cell 3
72 |}
73
74 The above table is rendered from:
75
76 <verbatim>
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 | <b>Header 1</b>
82 | <b>Header 2</b>
83 | <b>Header 3</b>
84 |- style=height:100px
85 | Cell I
86 | <b>Cell II</b>,  in bold
87 |align=right, width="100%" |Cell III
88 |- bgcolor=#f0f0ff, align=center
89 |Cell 1||Cell 2||Cell 3
90 |}
91 </verbatim>
92
93 In this example, there is no explicit call to the plugin. You have the same syntax as in Mediawiki.
94
95 You can also explictly call the plugin. This will allow you:
96 * to use the Mediawiki header syntax (!),
97 * to use multiple paragraphs in a cell,
98 * to use lists in a cell.
99
100 <?plugin MediawikiTable
101 {|
102 |- style="white-space: nowrap"
103 ! Header 1
104 ! Header 2
105 |- bgcolor=yellow
106 | First paragraph.
107
108 Second paragraph.
109 |
110 * One
111 * Two
112 * Three
113 |- bgcolor=#f0f0ff, align=center
114 |Cell 1||Cell 2
115 |}
116 ?>
117
118 The above table is rendered from:
119
120 <verbatim>
121 <?plugin MediawikiTable
122 {|
123 |- style="white-space: nowrap"
124 ! Header 1
125 ! Header 2
126 |- bgcolor=yellow
127 | First paragraph.
128
129 Second paragraph.
130 |
131 * One
132 * Two
133 * Three
134 |- bgcolor=#f0f0ff, align=center
135 |Cell 1||Cell 2
136 |}
137 ?>
138 </verbatim>
139
140 !!! Author
141
142 Marc-Etienne Vargenau, Alcatel-Lucent
143
144 ----
145 [PhpWikiDocumentation] [CategoryWikiPlugin]
146