2006-06-21
Patch committed to the SVN repository - to be included in
1.1.7.0:
Patched files:
I've hacked together a simple table markup for
WikkaWiki; it is working it's way from a "layout" table markup to an accessible data table markup.
Right now the markup should support most elements and attributes available in the
xhtml standard. This includes table header elements (
<th>) and table data elements (
<td>), table sections (
<thead>, <tbody>, <tfoot>, <col>, <colgroup>) and caption (
<caption>). Additionally these elements can be fleshed out with table spesific attributes (like cells spanning several columns and/or rows, table summary,
scope attributes for headers) in addition to general attributes (like
id, class, title and
style).
Example:
||Row 1 Column 1||Row 1 Column 2||Row 1 Column 3||
||Row 2 Column 1||Row 2 Column 2||Row 2 Column 3||
The table data delimiter is two pipes (||).
- Use the delimiter to start a new table, row and/or cell.
- The current row is ended with a delimiter at the end of a line.
- The table is ended by starting the next line with anything else than a new delimiter after ending a row.
Example:
|=|Header Column 1|=|Header Column 2|=|Header Column 3||
||Row 2 Column 1||Row 2 Column 2||Row 2 Column 3||
The header cell delimiter is two pipes surrounding an equal sign (|=|).
- Use the delimiter to start a new table, row and/or cell.
- Ending a cell/row can be done with the datacell delimiter.
There are two different parts to the advanced part of the table markup.
- The element delimiters
- The attribute thingey
Elements are marked with two pipes surrounding a character symbol. Some of these are probably only interresting if you plan on using complex and/or accessible tables.
Example:
|!|
|?|The Caption||
|[|
|=|Header Column 1|=|Header Column 2||
|]|
|=|Footer Column 1|=|Footer Column 2||
|#|
||Row 1 Column 1||Row 1 Column 2||
||Row 2 Column 1||Row 2 Column 2||
= The elements/symbols are: =
- || - no symbol is the datacell element (<td>).
- |=| - equals sign is the headercell element (<th>).
- |?| - question mark is the caption element (<caption>).
- |!| - exclamation mark is the table element, more on this later (<table>).
- |[| - opening bracket is the table header element (<thead>).
- |]| - closing bracket is the table footer element (<tfoot>).
- |#| - hash is the table body element (tbody>).
- |-| - dash is the column element (<col>).
- |_| - underscore is the column group element (<colgroup>).
Attributes are specified between parenthesis
"(" and
")", and defined by one character keys. The attributes are separated by semicolon.
Example:
(i:table2;u:Example table)
(t:A title;c:class differentclass)
|!|(i:table2;u:Example table)||
|?|(t:Title for the caption)The Caption||
|[|
|=|Header Column 1|=|Header Column 2||
|]|
|=|Footer Column 1|=|Footer Column 2||
|#|
||Row 1 Column 1||Row 1 Column 2||
||Row 2 Column 1||Row 2 Column 2||
= The attributes/keys are: =
- Ending the table with a || delimiter without a newline adds another cell/column. (ie: if there is no more content after the table, or if there is a space after the delimiter).
- Attributes cannot contain a closing parenthesis in its data. (ie: ||(i:ident;t:title, do not use ) here)|| will end attribute parsing at the first ")" )