Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
jar
Table.jar 6.6 kB 10 06-Nov-2008 22:40 Dirk Frederickx Reset to v0.3
java
Table.java 15.6 kB 11 06-Nov-2008 22:41 Dirk Frederickx Reset to v0.3
gif
anchorLightBG.gif 0.1 kB 1 21-Feb-2006 17:59 206.17.172.5

This page (revision-121) was last changed on 11-Jun-2012 12:01 by 194.168.223.147  

This page was created on 15-Feb-2005 21:09 by DirkFrederickx

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Difference between version and

At line 1 removed 2 lines
[{TableOfContents }]
At line 5 changed 4 lines
This plugin implements additional table formatting for JSPWiki :
* extra syntax to merge cells horizontally and/or vertically (aka colspan and rowspan)
* multi-line table editing to ease the entry of complex table data, such as nested tables
* additional formatting for odd/even rows, headers, etc.
This plugin extends JSPWiki's table markup :
* merge cells horizontally and/or vertically (aka colspan and rowspan)
At line 10 changed one line
* client-side sorting of tables : now handled by [BrushedTemplateSortableTables] / 24 oct 05
* multi-line table markup to ease the entry of large or complex table cells, including nested tables
* additional formatting for odd/even rows, headers, etc.
At line 13 removed 3 lines
! Usage:
{{{
[{Table <table-parameters>
At line 17 changed 36 lines
... body with table definition, don't forget to put an empty line before this body
}]
}}}
or use the full syntax when your searchPath was not modified
(see [How to install|9])
{{{
[{brushed.jspwiki.tableplugin.Table <table-parameters>
... body with table definition ...
}]
}}}
! Table Plugin parameters :
* __escape : <string>__ , escape special characters which normally are interpreted
as table syntax.
The first character after the 'escape string' will be passed unprocessed to the output.
This also allows you to call other plugins inside table cells. (see example [3])
\\The default 'escape' string is '~~'.
* __rowNumber : <integer>__ , row number starts counting at this value, default = 0
(used in conjunction with '#' syntax)
* __style : <css-style>__ , add formatting to the table
e.g. {{style:'border=2px solid black;'}}
* __dataStyle : <css-style>__ , format all data cells
(prefixed by single pipe signs '|')
* __headerStyle : <css-style>__ , format all header cells
(prefixed by double pipe signs '||')
* __evenRowStyle : <css-style>__ , format the even rows,
e.g. {{evenRowStyle='background: #ffff00;'}}
* __oddRowStyle : <css-style>__ . format the odd rows,
e.g. {{oddRowStyle='color: red;'}}
!Table syntax
The table plugin supports the standard JSPWiki table syntax :
%%tabbedSection
%%tab-TableSyntax
! Basic markup
The table plugin is compatible with the standard JSPWiki table syntax :
At line 23 added one line
! Extended markup
At line 73 changed 2 lines
|# |a |b |c |d
|# |^ |b |^ |d
|# |a |b |c |(background:yellow;)d
|# |^ |b |^ |(background:yellow;)d
At line 76 changed 8 lines
becomes
{{{
+----+-------+-------+
| Nr | A | C |
+----+---+---+---+---+
| 1 | a | b | c | d |
+----+ +---+ +---+
| 2 | | b | | d |
becomes (simulated)
At line 85 changed 3 lines
+----+---+---+---+---+
}}}
{{
&nbsp;&nbsp;+----+-------+-------+\\
&nbsp;&nbsp;| Nr | A &nbsp; &nbsp; | C &nbsp; &nbsp; |\\
&nbsp;&nbsp;+----+---+---+---+---+\\
&nbsp;&nbsp;| 1&nbsp; | a | b | c |%%(background:yellow;) d %%|\\
&nbsp;&nbsp;+----+ &nbsp; +---+ &nbsp; +---+\\
&nbsp;&nbsp;| 2&nbsp; | &nbsp; | b | &nbsp; |%%(background:yellow;) d %%|\\
&nbsp;&nbsp;+----+---+---+---+---+\\
}}
At line 90 changed 2 lines
This feature was implemented to overcome the limitation of having
to edit a complete table row on a single line of text.
The standard table markup of JSPWiki requires you to put every row on a single line without carriage returns.
At line 93 changed 11 lines
* When the line contains only one cell, it is assumed that
the table cell is continued on the next line.
(this is multi-line table editing)
** When the next line starts with '|' or '||', a new cell
on the same row is started.\\
Otherwise the line is added to the previous table cell
** All subsequent lines starting with '| or '||' are merged
into the same table row.
** An empty line ends the table row.
* When more than one table cell is encountered on the same line,
single-line editing is assumed, using the standard wiki syntax.
With the Table plugin, a single ''table row'' and even a single ''table cell'' can be entered on multiple lines.
At line 105 changed 3 lines
This way, it should be more easy to have lots of text, and even wiki markup,
merged into one table-cell. Table cells are listed underneath each other,
similar to a bulleted list.
A multi-line ''table row'' is similar to a bulleted list, where you replace the bullets ('*') with pipes ('|' or '||').
A blank line indicates the end of a table row.
{{{
| These cells
| will all appear
| as a single table row
At line 109 changed 2 lines
You can combine this multi line syntax with the '|<', '|^' and '#'
stuff as well as mix it with the more compact standard wiki table syntax.
}}}
It is also possible to put the contents of a single ''table cell'' across multiple lines.
So it is easy to put lots of text and markup inside a single table cell and still keep your markup readable.
{{{
| This cell
is put over 2 lines
| The 2nd cell comes here
At line 71 added 14 lines
}}}
You can combine muti-line rows with standard wiki table syntax too.
As long as a single line contains only one table cell, it is assumed to continue on the next line.
Multi-line rows always need to be terminated with blank lines; for standard wiki table rows you may omit the blank lines.
{{{
| This row has
| Two cells
| You can also | use standard wiki markup.
| Here is another | table row
}}}
Of course, you can combine this multi line syntax with the '|<', '|^' and '#' stuff as well.
At line 117 changed one line
| ''Gobble'' starts a new row!
| ''Gobble'' starts a new row!
At line 119 changed 2 lines
* and the name of this page [{$pagename}~]
| Bar
|(background:yellow;) Bar
At line 122 changed 2 lines
| [Main]
| [SandBox]
| [{Image src='some-nice-picture'}]
|<
At line 97 added 3 lines
%%
%%tab-Usage
! Usage
At line 126 changed one line
! Table sorting
{{{
[{Table <table-parameters>
At line 128 changed 3 lines
When enclosing the table in ''%{{}}%sortable'' markers, the table becomes sortable.
You need to install some javascript in your wiki template.
See [BrushedTemplateSortableTables] for more info.
|| Table Header Example || More...
| Table Data Example | More...
}]
}}}
At line 132 changed one line
----
Following parameters are supported:
At line 134 changed one line
!!Installation Instructions [how to install|#9]
* __rowNumber : <integer>__ , row number starts counting at this value, default = 0
(used in conjunction with '#' syntax)
* __style : <css-style>__ , add formatting to the table
e.g. {{style:'border=2px solid black;'}}
* __dataStyle : <css-style>__ , format all data cells
(prefixed by single pipe signs '|')
* __headerStyle : <css-style>__ , format all header cells
(prefixed by double pipe signs '||')
* __evenRowStyle : <css-style>__ , format the even rows,
e.g. {{evenRowStyle='background: #ffff00;'}}
* __oddRowStyle : <css-style>__ . format the odd rows,
e.g. {{oddRowStyle='color: red;'}}
At line 124 added 8 lines
! Change History
* v0.1 : first version
* v0.2 : client-side sorting of tables : now handled by [BrushedTemplateSortableTables] / 24 oct 05
* v0.3 : removed escape parameter: JSPWiki (v2.4.x) now supports nested plugin calls / jun 06
!Installation Instructions
At line 144 changed 5 lines
Additional stuff when you want to use the table sort functionality
* Copy [tablesort.js|http://webfx.eae.net/dhtml/tablesort/tablesort.js]
to your template directory (e.g. {{templates/default/tablesort.js}} )
* Add a reference to the tablesort.js in e.g. your {{templates/default/header.jsp}} file
{{{
%%
%%tab-Examples
At line 150 changed 2 lines
<script src="templates/<wiki:TemplateDir/>/cssinclude.js" type="text/javascript"></script>
<script src="templates/<wiki:TemplateDir/>/tablesort.js" type="text/javascript"></script> <!-- add this line -->
!Example 1 : table with row and column spans
At line 145 added 7 lines
{{{
[{Table
|Nr |A |< |C |<
|# |a |b |c |(background:yellow;)d
|# |^ |b |^ |(background:yellow;)d
}]
At line 154 changed 2 lines
''SS - The latest distribution doesn't have a header.jsp -- it has a commonheader.jsp. Also, the
relative URL shown doesn't work if you're using ShortViewURLConstructor -- I suggest inserting <wiki:BaseURL/> at the beginning, like this:''
[{Table
|Nr |A |< |C |<
|# |a |b |c |(background:yellow;)d
|# |^ |b |^ |(background:yellow;)d
}]
!Example 2: table with extra style
At line 157 changed one line
<script src="<wiki:BaseURL/>templates/<wiki:TemplateDir/>/tablesort.js" type="text/javascript"></script>
[{Table oddRowStyle='background:#f0f0f0;' rowNumber='-1'
|| [THE 15 MOST POPULAR ICE CREAM FLAVORS|http://www.sendicecream.com/15mospopicec.html]
||<
||<
|| ||Flavor|| percent preferring
|#. |Vanilla| 29%
|#. |Chocolate| 8.9%
|#. |Butter pecan| 5.3%
|#. |Strawberry| 5.3%
|#. |Neapolitan| 4.2%
|#. |Chocolate chip| 3.9%
|#. |French vanilla| 3.8%
|#. |Cookies and cream| 3.6%
|#. |Vanilla fudge ripple| 2.6%
|#. |Praline pecan| 1.7%
|#. |Cherry| 1.6%
|#. |Chocolate almond| 1.6%
|#. |Coffee| 1.6%
|#. |Rocky road| 1.5%
|#. |Chocolate marshmallow| 1.3%
|All others|< | 23.7%
}]
Source: International Ice Cream Association, 888 16th St. Washington, D.C., 20006
At line 160 changed 4 lines
* Add following css to the {{jspwiki.css}} located in that same template directory.
\\Note: when sort is on, the header cells located on the first row, are
encapsulated inside a THEAD element. The arrow class is used to display an up or
down arrow indicating the sort direction of the column which was clicked.
[{Table oddRowStyle='background:#f0f0f0;' rowNumber='-1'
|| [THE 15 MOST POPULAR ICE CREAM FLAVORS|http://www.sendicecream.com/15mospopicec.html]
||<
||<
|| ||Flavor|| percent preferring
|#. |Vanilla| 29%
|#. |Chocolate| 8.9%
|#. |Butter pecan| 5.3%
|#. |Strawberry| 5.3%
|#. |Neapolitan| 4.2%
|#. |Chocolate chip| 3.9%
|#. |French vanilla| 3.8%
|#. |Cookies and cream| 3.6%
|#. |Vanilla fudge ripple| 2.6%
|#. |Praline pecan| 1.7%
|#. |Cherry| 1.6%
|#. |Chocolate almond| 1.6%
|#. |Coffee| 1.6%
|#. |Rocky road| 1.5%
|#. |Chocolate marshmallow| 1.3%
|All others|< | 23.7%
}]
Source: International Ice Cream Association, 888 16th St. Washington, D.C., 20006
!Example 3: table with multi-line editing
At line 165 changed 8 lines
.arrow { font-family: webdings;
font-weight: normal; // be careful, dont remove
color: black;
overflow: hidden;
}
.wikitable thead td,
.wikitable th { /*give same formatting to header cells */ }
.sortable thead { cursor:pointer; }
[{Table style='border:3px solid #cccccc;'
|(text-align:center;font-weight:bold; background:#cccccc;) Hi dear Wiki.
|<
|<
| Date: [{CurrentTimePlugin format='dd:MMM:yyyy'}]
| Time: [{CurrentTimePlugin format='hh:mm:ss'}]
| This page: [{$pagename}]
| [{Table
| Nested table | Nested table
| Nested table | Nested table
}]
|<
|<
}]
At line 176 changed 2 lines
----
!Discussion
[{Table style='border:3px solid #cccccc;'
At line 243 added 22 lines
|(text-align:center;font-weight:bold; background:#cccccc;) Hi dear Wiki.
|<
|<
| Date: [{CurrentTimePlugin format='dd:MMM:yyyy'}]
| Time: [{CurrentTimePlugin format='hh:mm:ss'}]
| This page: [{$pagename}]
| [{Table
| Nested table | Nested table
| Nested table | Nested table
}]
|<
|<
}]
%%
%%tab-Discussion
! Discussions
At line 408 changed one line
;:Tx ! Actually, in v2.3.x JSPWiki now support nested plugins out of the box, so I am planning to remove the escape stuff from the plugin ... as soon as time permits. --[DF|DirkFrederickx]
;:Tx ! V0.3 has been adjusted accordingly. --[DF|DirkFrederickx], Jun 06
At line 417 changed one line
;:The TablePlugin stil works on v2.4.x. However, in case you have nested plugin calls in your table, you need to escape some chars. Because of the different behaviour of JSPWIki (it actually now supports nested plugins ! ) you need a bit to anticipate its behaviour. You need to escape BOTH the starting [[{ as well as the closing }] plugin brackets. (in the past, it was sufficient to escape the closing brackets only) --[DF|DirkFrederickx]
*The TablePlugin stil works on v2.4.x. However, in case you have nested plugin calls in your table, you need to escape some chars. Because of the different behaviour of JSPWIki (it actually now supports nested plugins ! ) you need a bit to anticipate its behaviour. You need to escape BOTH the starting [[{ as well as the closing }] plugin brackets. (in the past, it was sufficient to escape the closing brackets only) --[DF|DirkFrederickx]
*V0.3 has been uploaded!. Plse try with the latest plugin version --[DF|DirkFrederickx], Jun 06
%%
%%
Version Date Modified Size Author Changes ... Change note
121 11-Jun-2012 12:01 41.001 kB 194.168.223.147 to previous
« This page (revision-121) was last changed on 11-Jun-2012 12:01 by 194.168.223.147