Extended Table Action Documentation


See also:
This is the documentation page for a proposed extended table action. The code is available on the TableAction page. The development of this action has been discontinued since the implementation of a new table markup in the main development line.
 

Documentation


Short description
Turns a simple list of cell contents into a (data) table.

Parameters
nametyperequired?defaultdescription
delimitercharoptionalsemicolon (;)delimiter that will be used to separate cells; must be a single character.
delimcharoptional;synonym of delimiter
captionstringoptionalnonetable caption
columnsintegeroptional1number of columns the table is to have.
colsintegeroptional1synonym of columns
borderintegeroptional1borderwidth of table.
cellpaddingintegeroptional3padding within cells in pixels.
cellspacingintegeroptional1space between cells in pixels.
stylestringoptionalnonein-line style for the table.
classstringoptionalnonealternative for style: use the class to style with the stylesheet.
summarystringoptionalnonesummary of what the table contains.
cellsstringrequiredcontent of the table with cells separated by the (defined) delimiter.

Long description
Wikka markup within cells is interpreted but HTML markup for cell contents is not possible.

There is only one required paramater: cells; if this is missing an error message will be displayed, along with the original action markup.

It is possible to define cell contents across multiple lines; surrounding whitespace is trimmed before generating output, embedded whitespace (including newlines) is retained.

Cell contents must be separated by a delimiter character; by default this is a semicolon, but if this would conflict with cell contents, a delimiter can be defined with the delimiter (or delim) parameter. Superfluous delimiters at the start and end of the cells parameter are discarded, so it's possible to write each cell row on a separate line, and end each cell with the delimiter: this makes it relatively easy to maintain table contents.

A caption can be defined, as well as a summary.
There is limited support for table headers (th cells): if cell content is embedded in sets of 2 to 5 '=' characters (as in heading markup) these will be discarded and a header cell (th) will be generated instead of a data cell (td). Row groups (thead, tfoot, tbody) are NOT supported.
The result is valid (data) table markup although accessibility will be limited.

Author
JavaWoman

Examples




CategoryDevelopment
Comments
Comment by YanB
2005-03-03 11:03:22
hi JW, sorry, I don't understand the last example. I've tried to copy the example code, and it always says: '... must not contain special characters'.
Comment by JavaWoman
2005-03-03 11:41:53
Yan,
Did you maybe copy from the source of this page? The examples are setup to be shown in the rendered page, so they contain <br /> to force line breaks; if you copy from the rendered page you will get the newlines (as intended) without the <br /> (which should not be there).
If that doesn't solve it, can you explain exactly where/when that error message appears?
Comment by YanB
2005-03-03 13:12:54
I put this:
{{table cols="3" cellpadding="10" delimiter="\"
cells="\\\\==a==\==b==\==c==\
//1//\**2**\@@3@@\
\\//last cell//\\"
}}
So, no, no html/forced line breaks in there, and this is what I get:
"Unknown action; the action name must not contain special characters." I'm running on 1.1.6.0, so that's not the pbl. :(
Comment by LocK
2005-03-06 21:04:41
Yan,
Goto http://wikka.jsnx.com/TableAction to patch for the multiline action/parameter first!
Otherwise, the parser can't handle multiline action like the latest example. : )
Comment by JavaWoman
2005-03-06 22:29:00
LocK,
Thanks for catching that - I just realized this page didn't make it clear it's documenting a *proposed* extended table action. I've corrected that now.
Comment by AlessandroMelandri
2005-06-22 21:52:50
I don't like so much the way this action handles table headers so I modified the table action adding the parameter 'header'.
If the parameter is not set or is set to zero the table will be displayed as usual, if it's set to 1 the first row will be rendered as a table header (th).

You can see it in action at wiki.smallpiece.info/SandBox
Comment by 62-101-126-218.fastres.net
2005-06-23 14:55:24
Hi Alessandro!
Looks promising. Maybe you want to share the code here on this wiki, so that other interested users can use it, too?
Comment by AlessandroMelandri
2005-06-24 10:18:38
I haven't a deep knowledge of thiw wiki so I don't know where to put it.
I set up a page on my wiki with the mod.

wiki.smallpiece.info/WikkaTable

Look at inline commenst. I'm planning to add some explanation but now I'm really too busy. :-)
Comment by JavaWoman
2005-06-24 23:22:22
Alessandro,

I looked at your page and it's a really good idea. (Even though the "improved" Table action is just a kluge to tide us over until we have an actual "table markup).
One problem though: the page is decared to be covered by the Creative Commons license; unfortunately that is incompatible with the GPL license that Wikka is released under.

So we could just "ignore" your code (and maybe make our own change) - or you could maybe change your page and release your modification under GPL (or LGPL)... or - as was suggested - you could post your mod (code and explanation) on this site and allow it to be included (literally or with modifications).
Comment by AlessandroMelandri
2005-06-27 06:04:14
I will surely change the license for the code to GPL! :-) I'll do this evening when i'll be back at home.
Comment by AlessandroMelandri
2005-06-27 13:33:59
Ok, now the code is published under GPL. Fell free to use and modify it.
Comment by AlessandroMelandri
2005-06-27 20:08:26
I've added another option: now if you set the header parameter to "2", also the first cell of every row will be rendered as a th. Hope you enjoy.
Should I insert my code in the table action development page?
Comment by ChrisH
2005-12-21 23:00:02
I'm confused. I can't get the headers of my table to work. I've followed the examples above, but what I get looks like this: ==Name==, instead of being a header.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki