Extension:TableEdit

Rationale and Features
Wiki markup can be challenging. Tables are one of the harder things for new users. TableEdit provides a simple table creation and editing system.

TableEdit replaces &lt;newTableEdit/&gt; tags in wikitext with a "Create Table Here" link. Following this link goes to a Special page that creates HTML comment-delimited tables The content is controlled by an external mysql database, but the tables are saved back to the wiki in normal wikitext surrounded by HTML comments with the id number of the table in the database. Users can


 * Insert rows
 * Append columns
 * Change styles for tables, heading rows, and rows
 * Use template-defined lists of column headings

See EcoliWiki for more about the TableEdit features and how to use them.

Status
So far, TableEdit 1.0.0 has been tested with MediaWiki 1.21 on MacOSX and Ubuntu. Help testing this extension on other versions will be appreciated!

Changes in Version 1.0.0

 * Support for DataTables (http://datatables.net) was added in version 1.0.
 * modules/TableMarkerUpper.php
 * This script adds a necessary tag to any tables in.
 * addition of the (optional) parameter in templated tables
 * addition of class="" and id="" attributes on wiki tables
 * CSS and JS specific to tableEdit
 * TableEdit::reorder_columns
 * TableEdit::reorder_template

See the README and README.dataTables files for more info.

Installation

 * See the INSTALL file in the package for these directions. Also check the discussion page of this article for quite a number of bugs!

To do a fresh install (rather than an upgrade):


 * Download the TableEdit extension.
 * Unpack the downloaded file using gunzip or another unpacking program.
 * Move the unpacked TableEdit directory to your MediaWiki extensions directory.
 * Note: Because we run multiple wikis from the same set of extensions at EcoliWiki, we consolidated our extensions into a common directory. (i.e. we don't use the extensions/ directory within each installation.) This is why TableEdit includes the CSS and JS directly into the page instead of linking out to them (yes, I know it's better to cache them.)
 * If you don't already have an file in your MediaWiki installation directory, create one. This contains the database admin username and password for your MediaWiki database. TableEdit needs this information to create some tables in the database. Note that AdminSettings.php was removed in MediaWiki version 1.23.
 * Backup your MediaWiki database. This is an important step in case anything goes wrong.
 * Get to your extensions/TableEdit directory (or wherever TableEdit lives) and run the install.php.
 * On a *nix-like system with PHP installed (PHP v5.3 may have problems...) php install.php -w /path/to/your/wiki The -w parameter is the path to your MediaWiki installation. This is usually "../.." from the extensions/TableEdit directory. Right now TableEdit has only been tested with MySQL. If you are using a different database server, you may want to have a look in the sql/ directory for the sql files and create these tables by hand.
 * Add the following lines to your LocalSettings.php file: (making sure the paths are correct)

Directly editing TableEdit definitions in the page source will usually break the table's definition. TableEdit generates inline comments telling editors not to edit the table, but TableEdit by itself does not prevent it.

Other helpful pages

 * Extension:TableEdit/Details
 * contains some information about how to create a template, specify column-rules, etc.


 * Extension:TableEdit/IFALT format
 * defines a tab-delimited format for loading data into tables. (Yes, we thought about using XML.)


 * Extension:TableEdit/Loader
 * describes the PHP script used to load information (in IFALT) into tables.

Known issues

 * TableEdit has problems if you try to create a table on a new page that has not been saved yet.
 * A page must be saved in order to get a page_id value in the database that is needed by TableEdit.
 * Can't get the content back if the table is edited directly in the wiki. This can be prevented by combining TableEdit with the ProtectSection extension.
 * Can't sort (without JavaScript)
 * Can't insert columns in the middle
 * Preview doesn't display initial empty table properly
 * Can't have empty heading - although having a "space" as a heading overcomes this. Empty headings are truncated when editing after first saved.

Dumps
While tables will be preserved when importing a dump from a wiki that uses TableEdit, when a user tries to click on the Edit link, bad things are likely to happen. In the best case, the recipient wiki will not have TableEdit installed and there will just be a 404 error. If TableEdit is installed, the most likely outcome is that the box_id and pagename will not match what is stored in the database and TableEdit will refuse to do the edit on the imported page. Suggestions for how to solve this are welcomed!

Bug Reporting
Please report bugs on the discussion page. Please sign your entries with your Name/IP and date using ~.

For example: JimHu 22:14, 27 August 2008 (UTC)