This is a static copy of the main wikispot.org site, preserved for historical purposes only. Please see this page for more information.

Help with Tables

InfoInfo TalkTalk
Search:    

  1. Table Markup
    1. Attributes
      1. General Attributes
      2. Row and Table Attributes
      3. Shorthand Attributes
  2. Example
    1. Display
Welcome, this is a page to help with tables. Tables are very useful for organizing data, but they can be one of the more complex objects on a wikipage.

For more information on general wiki markup, see Help with Editing.

Table Markup

To create a table, you start and end a line using the table marker "||". Between those start and end markers, you can create any number of cells by separating them with "||". To get a centered cell that spans several columns, start that cell with more than one cell marker. Adjacent lines of the same level of indentation (i.e. number of spaces) containing table markup are combined into one table.

Attributes

General Attributes

Apart from the option to repeat table markers to get cells spanning across several columns, you can directly set many HTML table attributes. Any attributes have to be placed between angle brackets <...> directly after the cell marker. If you use more than one of these attributes, they should be separated by a space.

The options are the following:

Remember that to include multiple attributes you enclose all attributes into the same set of angle brackets for the cell. So to have a cell aligned to the right, spanning seven rows, and with a Lavender Blush background, you would use this attribute: <align="right" rowspan="7" bgcolor="LavenderBlush">.
If you use several conflicting options like <valign="top" valign="bottom">, the last option wins.

Row and Table Attributes

You can also set the attributes for a row of cells, or for an entire table, by prefixing the name of the attribute with table or row. If you want to set an attribute for the whole table, you should probably do it in the first cell of the table. Possible tags:

Note that cell attributes (such as bgcolor) take dominance over row attributes (such as rowbgcolor) which in turn are dominant over the table attributes (such as tablebgcolor). In addition, in a series of conflicting tags, the last one is dominant.

Shorthand Attributes

In addition to these you can use a shorthand markup, which is a little bit harder to read but is good for wiki-ninjas to quickly change a table. These attributes only apply to a single cell rather than a row or the entire table.

The wiki-like markup has the following options:

If you use several conflicting options like <(:)>, the last option wins. Also, the non-shorthand tags may be included in the same tag as shorthand. This allows the use of named colors (such as LavenderBlush) with shorthand, and allows users unfamiliar with the system the ability to simply overwrite the shorthand by adding attributes following the short hand.

Example

  General table layout and HTML like options::
 ||||||<tablewidth="80%" bgcolor="#DDDDDD">'''Heading'''||
 ||cell 1||cell 2||cell 3||
 ||<rowspan="2"> spanning rows||||<bgcolor='#E0E0FF'> spanning 2 columns||
 ||<rowbgcolor="#FFFFE0">cell 2||cell 3||
 The same with shorthand attributes::
 ||||||<tablewidth="80%" #DDDDDD>'''Heading'''||
 ||cell 1||cell 2||cell 3||
 ||<|2> spanning rows||<-2#E0E0FF> spanning 2 columns||
 ||<rowbgcolor="#FFFFE0">cell 2||cell 3||
 Cell width::
 || narrow ||<:85%> wide ||
 Spanning rows and columns::
 ||<|2> 2 rows || row 1 ||
 || row 2 ||
 ||<-2> row 3 over 2 columns ||
 Alignment::
 ||<tableborder="1">||<^> top {{{<^>}}}|| ||
 ||<(> left {{{<(>}}}||<:> centered {{{<:>}}}||<)> right {{{<)>}}} ||
 || ||<v> bottom {{{<v>}}}|| ||
 Colors::
 ||<#FF8080> red ||<#80FF80> green ||<#8080FF> blue ||

and now a table with a border:
||<tableborder="1">item one||item 2||

Display

and now a table with a border:

item one item 2
This is a Wiki Spot wiki. Wiki Spot is a 501(c)3 non-profit organization that helps communities collaborate via wikis.