Help:Tables-How to edit

From OMPwiki
Revision as of 16:04, 16 March 2015 by Saleksander (talk | contribs)

Basic usage

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:
<newTableEdit>
Heading 1
Heading 2
Heading 3
etc...
</newTableEdit>
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.


Example

Creating a New Table

1. Click on the "create table" quick button. This will insert the tags <newTableEdit> and </newTableEdit> automatically.
File:Newtable 1.jpg
Click on the quick button to create a new table



2. Create the table headings by typing inside the <newTableEdit> tags.
<newTableEdit>
US State
Capitol
Governor
</newTableEdit>
File:Newtable 2.jpg
Create the headings for your table



3. Type a short summary of your edit and click save
File:Newtable 3.jpg
Save your work




4. Click on the edit table link to go to the Table Editor.
File:Newtable 4.jpg
Click "edit table"



5. Add a row.
File:Newtable 5.jpg
Click "add 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.
File:Newtable 6.jpg
Add your data and save



Editing the Headings

7. Let's add a column called "State Bird". First click Edit Headings
File:Newtable 7.jpg
Click "Edit Headings"



8. Then click Add headings. You can now name your head in the box provided. Now click save..
File:Newtable 8.jpg
Click "Add Headings", type the heading name, then "save"



9. Save the table back to the wiki page.
File:Newtable 10.jpg
Save the table



10. Your table will look like this now:
File:Newtable 11.jpg
New Table Created



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


List of Table Templates in OMPWiki

See Category:Table_templates