HowToCreateATableAdvanced
Back to current versionRestore this version

Basic markup#

The table plugin is compatible with the standard JSPWiki table syntax :
  • a new line of text starting with a pipe sign '|' indicates the start of a new table row.
  • every line corresponds with a horizontal row of the table, containing one or more table cells.
    • a single pipe signs ('|') starts a new data cell.
    • a double pipe signs ('||') starts a header cell with different formatting.
  • end the table with a line which does not start with a pipe sign.

Extended markup#

Following syntax is also supported:
  • use '|<' or '||<' to collapse a cell with the previous cell so it spans multiple columns.
  • use '|^' or '||^' to collapse a cell with the cell above so that it spans multiple rows.
  • use '|( <css-style> ) ' to add specific formatting to a cell.
  • use '#' inside a table cell to display the current row number. (auto row numbering)

Example:

   |Nr |A |< |C |<
   |#  |a |b |c |(background:yellow;)d
   |#  |^ |b |^ |(background:yellow;)d
becomes (simulated)

  +----+-------+-------+
  | Nr | A     | C     |
  +----+---+---+---+---+
  | 1  | a | b | c | d |
  +----+   +---+   +---+
  | 2  |   | b |   | d |
  +----+---+---+---+---+

Multi-line table editing#

The standard table markup of JSPWiki requires you to put every row on a single line without carriage returns.

With the Table plugin, a single table row and even a single table cell can be entered on multiple lines.

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

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

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.

Example:

   || Heading 1 
   || Heading 2

   | ''Gobble'' starts a new row! 
   * and some more text with wiki markup, all in the same table cell
   |(background:yellow;) Bar

   | [{Image src='some-nice-picture'}]  
   |<

JSPWiki : HowToCreateATableAdvanced - Plugin insertion failed: Could not find plugin TableJSPWiki : HowToCreateATableAdvanced - Plugin insertion failed: Could not find plugin Table

JSPWiki : HowToCreateATableAdvanced - Plugin insertion failed: Could not find plugin TableJSPWiki : HowToCreateATableAdvanced - Plugin insertion failed: Could not find plugin Table Source: International Ice Cream Association, 888 16th St. Washington, D.C., 20006

JSPWiki : HowToCreateATableAdvanced - Plugin insertion failed: Could not find plugin TableJSPWiki : HowToCreateATableAdvanced - Plugin insertion failed: Could not find plugin Table