Warning: The code or configuration described here poses a major security risk.
Site administrators: You are advised against using it until this security issue is resolved.
Problem: Vulnerable to Cross-site scripting attacks, because it passes user input directly to the browser. This may lead to user accounts being hijacked, among other things.
Solution: strictly validate user input and/or apply escaping to all characters that have a special meaning in HTML
Release status: unstable
|Description||Converts tab- (or comma-) separated data into a Wiki table.|
|License||No license specified|
The SimpleTable extension allows tabular data to be easily cut-and-pasted into a Wiki; for example, this allows a CSV export from Excel to be pasted in without having to manually edit it into Wiki table syntax. It's really crude, and doesn't allow any kind of clever formatting; for example, there is no way to set row and cell parameters, including row and cell spanning.
All you need to do is prepare your data in rows, with fields separated by tab characters. (Excel's
"Save as" → "Text (Tab delimited)" function saves data in this format.) Place the data inside
<tab>...</tab> tags, and set any table parameters inside the opening
<tab border=1> Field 1→Field 2→Field 3 Field 4→Field 5→Field 6 Field 7→Field 8→Field 9 </tab>
→ represents a tab character) produces the corresponding table. Most table parameters should work; for example, if your wiki has the
wikitable CSS class defined, then this markup should work:
<tab class=wikitable> . . .
You can use a different separator, using the
sep can be one of:
- a tab
- a space
- one or more spaces and/or tabs
- a comma
- a vertical bar (|)
- a semicolon
You can also specify that either the top row or the left column should be formatted as a heading, using the
head can be one of:
- make the top row a heading
- make the left column a heading
- do both
Oddly Top headings are done by default if head is omitted, use 'head=' to remove them
<tab class=wikitable sep=comma head=top> Head 1,Head 2,Head 3 Field 4,Field 5,Field 6 Field 7,Field 8,Field 9 </tab>
produces a table with a heading row and two data rows, all having three columns.
- Download, unzip and place the file(s) in a directory called
- Add the following code at the bottom of your LocalSettings.php:
wfLoadExtension( 'SimpleTable' );
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.