TableEdit provides a more user-friendly way to create and edit tables in MediaWiki than using the standard wiki mark-up. TableEdit tables show up in a page with their own Edit link. Registered users can then add rows and columns, add information, and/or edit information already in the table.
Create a new table
Step 1: Add a newTableEdit tag where you want the table to appear.
To add a new table that can be edited by TableEdit, there are two options:
- Add an empty table by putting <newTableEdit/> in the text where you want the table to appear.
- Add a table with defined headings by entering the following:
- Heading 1
- Heading 2
- Heading 3
- You can edit the columns later if needed.
Step 2: Save the page.
If you used option 2, an empty table with your headings appears when you save the page. Note that the default table has the column headings arrayed horizontally from left to right. You can change the orientation when you edit the table.
If you used option 1, there will a Create table here link. You can create the headings when you edit the table.
Step 3: Edit the table Click on the link and use the table editor to add information.
Creating a New Table
- 1. Click on the "create table" quick button. This will insert the tags <newTableEdit> and </newTableEdit> automatically.
- 2. Create the table headings by typing inside the <newTableEdit> tags.
- US State
- 3. Type a short summary of your edit and click save
- 4. Click on the edit table link to go to the Table Editor.
- 5. Add a row.
- 6. Add any information you know and click save.
- Lets say I don't know the governor, so I'll leave it for someone else to add.
Editing the Headings
- 7. Let's add a column called "State Bird". First click Edit Headings
- 8. Then click Add headings. You can now name your head in the box provided. Now click save..
- 9. Save the table back to the wiki page.
- 10. Your table will look like this now:
Basic Table templates
For table formats that you plan to use on more than one page, you can define a template. The template should be a Template page in the wiki that has a list of the table headings. When a table is made using a template, the headings can only be edited on the template page. Changing the template page will change the headings on all tables that use that template. Note that the changes won't be apparent until someone tries to edit the table and save it back to the page.
To add a table based on a template to a wiki page, put: <newTableEdit>Template:TemplateName</newTableEdit>.
To Find your specific TemplateName please see Table Templates.
Advanced Table templates
Using tags to specify more table properties
Attributes for the table can be wrapped in XML-like tags.
- Use <type>1</type> to create a vertical table, i.e. the headings are arrayed from top to bottom in the first column. The default is a horizontal orientation where the headings are arrayed from left to right in the first row.
- Use <headings></headings> for headings. Headings can have additional attributes, which can be used to customize the user interface and link content of rows to external sources (see below).
- Use <heading_style></heading_style> for heading style
- Use <table_style></table_style> for table style
Programming the TableEdit interface
Heading lists can have additional markup to modify the behavior of the Table Editor. Anything after a || in the headings list is considered part of a list of additional parameters for that heading. Individual parameters are delimited by single |s. The first parameter after the heading text is a unique column_name for the heading (this allows you to use non-unique names for the actual display). If this is not present, the heading name is assumed to be usable as the column_name. These are used for lookup and calculation fields as described below