Template:Table/documentation: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
Line 36: Line 36:
==Notes==
==Notes==


To automatically create a table, you can use the free tool at http://excel2wiki.net/index.php to convert an Excel table into the appropriate wiki code. This template is designed to work with the output you get from that tool.  
To automatically create a table, you can use the free tool at http://excel2wiki.net/index.php to convert an Excel table into the appropriate wiki code. To ensure that the output you get from the tool works with this template, you must remove the formatting that the tool automatically assigns to the table headers. For instance, if you copy and paste our example table into the tool, the output will be:
 
<pre>{| {{table}}
| align="center" style="background:#f0f0f0;"|'''Column 1'''
| align="center" style="background:#f0f0f0;"|'''Column 2'''
|-
| Row 1||123
|-
| Row 2||456
|-
| Row 3||789
|}}</pre>
 
In this case, you must delete the formatting around "Column 1" and "Column 2" and replace them with exclamation marks <code>!</code>. (See the code shown in the Usage section to what this looks like.) In wiki table code, an exclamation mark indicates a table header. Table headers appear in bold and are centered by default.


If you want to learn how to create tables using wiki code, see the tutorial at http://www.mediawiki.org/wiki/Help:Tables.
If you want to learn how to create tables using wiki code, see the tutorial at http://www.mediawiki.org/wiki/Help:Tables.

Revision as of 20:25, 30 May 2014


Template Documentation

This template contains table formats that can be applied to any existing table in ReliaWiki. It does not automatically create a table for you; rather it ensures that any table it is linked to will have consistent looking borders and cell padding. (If you don't know how to create a table, see the Notes section below.)

Here is an example of what a generic table looks like when you use this template.

Column 1 Column 2
Row 1 123
Row 2 456
Row 3 789


Usage

To use this template, type the code {{Table}} next to the table's opening brackets. For example, below is the code for the example table shown above.

{| {{Table}}
! Column 1
! Column 2
|-
| Row 1||123
|-
| Row 2||456
|-
| Row 3||789
|}

Notes

To automatically create a table, you can use the free tool at http://excel2wiki.net/index.php to convert an Excel table into the appropriate wiki code. To ensure that the output you get from the tool works with this template, you must remove the formatting that the tool automatically assigns to the table headers. For instance, if you copy and paste our example table into the tool, the output will be:

{| {{table}}
| align="center" style="background:#f0f0f0;"|'''Column 1'''
| align="center" style="background:#f0f0f0;"|'''Column 2'''
|-
| Row 1||123
|-
| Row 2||456
|-
| Row 3||789 
|}}

In this case, you must delete the formatting around "Column 1" and "Column 2" and replace them with exclamation marks !. (See the code shown in the Usage section to what this looks like.) In wiki table code, an exclamation mark indicates a table header. Table headers appear in bold and are centered by default.

If you want to learn how to create tables using wiki code, see the tutorial at http://www.mediawiki.org/wiki/Help:Tables.