Difference between revisions of "Help:MediaWiki basics/Intermediate training"

From LIMSWiki
Jump to navigationJump to search
(Created as needed.)
 
m (Text replacement - "LIMS vendor" to "LIMS vendor")
 
(19 intermediate revisions by the same user not shown)
Line 17: Line 17:
If you viewed the beginner training guide, you likely noticed several instances of gray boxes with wiki code and other text in them. How do you display that content like that without the system running any associated code? You do it by using the preformatted text tag <nowiki><pre></nowiki> to display the code without rendering it. For example, here is the code used to create that box at the top of this page, displayed (but not run) using the <nowiki><pre></nowiki> tag, the content, and then the closing <nowiki></pre></nowiki>:
If you viewed the beginner training guide, you likely noticed several instances of gray boxes with wiki code and other text in them. How do you display that content like that without the system running any associated code? You do it by using the preformatted text tag <nowiki><pre></nowiki> to display the code without rendering it. For example, here is the code used to create that box at the top of this page, displayed (but not run) using the <nowiki><pre></nowiki> tag, the content, and then the closing <nowiki></pre></nowiki>:


<pre>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">
{{ombox
{{ombox
| type      = notice
| type      = notice
Line 25: Line 25:
</pre>
</pre>


====Code and nowiki====
====The code and nowiki tags====


If you wish to show some sort of code inline, without the big block of gray, you can combine two HTML-style tags to create that effect: <code><nowiki>&lt;code&gt;</nowiki></code> and <code><nowiki>&lt;nowiki&gt;</nowiki></code>. For example, here's the same code from above but inline:
If you wish to show some sort of code inline, without the big block of gray, you can combine two HTML-style tags to create that effect: <code><nowiki>&lt;code&gt;</nowiki></code> and <code><nowiki>&lt;nowiki&gt;</nowiki></code>. For example, here's the same code from above but inline:
Line 39: Line 39:
We achieve that by doing the following:
We achieve that by doing the following:


<pre>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">
<code>&lt;nowiki&gt;
<code>&lt;nowiki&gt;
{{ombox
{{ombox
Line 51: Line 51:
Essentially the <code><nowiki>&lt;code&gt;</nowiki></code> tag tells the system to show the text inline instead of in block format (like preformatted text), and the <code><nowiki>&lt;nowiki&gt;</nowiki></code> tag tells the system to not run that text as code but treat it as plain text.
Essentially the <code><nowiki>&lt;code&gt;</nowiki></code> tag tells the system to show the text inline instead of in block format (like preformatted text), and the <code><nowiki>&lt;nowiki&gt;</nowiki></code> tag tells the system to not run that text as code but treat it as plain text.


'''Note''': Leave <code><nowiki>&lt;pre&gt;</nowiki></code> for larger blocks. Using the described combination of tags is much better suited for small bits of code. For example: <code><nowiki>[[Help:MediaWiki basics/Beginner training|beginner training guide]]</nowiki></code>
'''Note''': Leave <code><nowiki>&lt;pre&gt;</nowiki></code> for larger blocks. Using the described combination of <code><nowiki>&lt;code&gt;</nowiki></code> and <code><nowiki>&lt;nowiki&gt;</nowiki></code> tags is much better suited for small bits of code.  
 
For example:
<pre>
<code>&lt;nowiki&gt;[[Help:MediaWiki basics/Beginner training|beginner training guide]]&lt;/nowiki&gt;</code>
</pre>
 
...yields: <code><nowiki>[[Help:MediaWiki basics/Beginner training|beginner training guide]]</nowiki></code>


This may seem a bit confusing at first, but don't worry. You'll get the hang of this type of formatting.
This may seem a bit confusing at first, but don't worry. You'll get the hang of this type of formatting.
====Additional tags====
Other HTML-based tags can be inserted into your wiki edits, though they should be used sparingly. Try to focus on using wiki-based formatting when possible.
* <tt>Typewriter font</tt>: <code><nowiki><tt>Typewriter font</tt></nowiki></code>
* <strike>Strike out</strike> or <u>underline</u>: <code><nowiki><strike>Strike out</strike> or <u>underline</u></nowiki></code>
* X<sup>3</sup>, H<sub>2</sub>O: <code><nowiki>X<sup>3</sup>, H<sub>2</sub>O</nowiki></code>
* <blockquote>The '''blockquote''' command will indent both margins when needed.</blockquote><code><nowiki><blockquote>The '''blockquote''' command will indent both margins when needed.</blockquote></nowiki></code>
===Including media===
====Images====
There are a couple of ways to place images into wiki content: link to images from Wikimedia Commons or like to images uploaded to the wiki.
'''Wikimedia Commons'''
[[commons:Main Page|Wikimedia Commons]] (WC) is a "media file repository making available public domain and freely-licensed educational media content (images, sound and video clips) to everyone." LIMSwiki utilizes an extension which allows users to directly link to WC content using only the file name. Below is an example of such a link as well as the code to display it:
[[File:Sm-Wikipuzzlepiece.png]] ...and the code: <code><nowiki>[[File:Sm-Wikipuzzlepiece.png]]</nowiki></code>
Essentially you find an image you want to use on WC and place the name (File:Filename.format) between two opening and closing brackets (as you would an internal link). Of course, there are many additional parameters you can add to the image.
[[File:Sm-Wikipuzzlepiece.png|right]]For example, you can float the image to the right.
The code: <code><nowiki>[[File:Sm-Wikipuzzlepiece.png|right]]</nowiki></code> ...and the image --->
<br />
You can also add a thumbnail border, specify the size, and add description text:
[[File:Sm-Wikipuzzlepiece.png|thumb|left|80px|Description here]]
<br />&nbsp;<br />
...and the code: <code><nowiki>[[File:Sm-Wikipuzzlepiece.png|thumb|left|80px|Description here]]</nowiki></code>
<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />
As seen in the code above, each parameter is separated by a pipe (|).
The most common parameters:
; ''Type'' : "<code>thumb</code>" (or "<code>thumbnail</code>"; either can be followed by "<code>=<var>filename</var></code>"), "<code>frame</code>" (or "<code>framed</code>"), or "<code>frameless</code>". Display the image with specific formatting.
; ''Location'' : "<code>right</code>", "<code>left</code>", "<code>center</code>" or "<code>none</code>". Determine the horizontal placement of the image on the page. This defaults to "<code>right</code>" for thumbnails.
; ''Alignment'' : "<code>baseline</code>", "<code>middle</code>", "<code>sub</code>", "<code>super</code>", "<code>text-top</code>", "<code>text-bottom</code>", "<code>top</code>", or "<code>bottom</code>". Vertically align the image with respect to adjacent text. This defaults to "<code>middle</code>".
; ''Size'' : "'''Width'''<code>px</code>" or "<code>x</code>'''Height'''<code>px</code>" or "'''Width'''<code>x</code>'''Height'''<code>px</code>". Scale the image to be no greater than the given width and/or height, keeping its aspect ratio.
; ''Alt'' : Specify the alternate text for the image. This is intended to describe the image for visually impaired readers.
Covering all the parameters of image placement is beyond the scope of this training session. However, here are a couple of great sources for learning more about the parameters you can use with image files:
* MediaWiki Handbook: [https://meta.wikimedia.org/wiki/Help:Images_and_other_uploaded_files Help:Images and other uploaded files]
* Wikipedia: [https://en.wikipedia.org/wiki/Wikipedia:Extended_image_syntax Wikipedia:Extended image syntax]
'''Uploaded image'''
In some cases an image you need to use isn't available on Wikimedia Commons (WC). In this case you can [[Special:Upload|upload]] ''public domain'' and ''copyright-free'' images directly to the wiki. Once the upload is finished, the procedure for placing uploaded images into wiki pages is exactly the same as with WC content. You simply use the file name used for the wiki upload.
====Other media====
Sound and video files can also be embedded into a page. The formatting is similar to images in that you can simply use <code><nowiki>[[File:Filename.format]]</nowiki></code> plus applicable parameters.
Here's an example of a Wikimedia Commons sound file in .ogg format:
[[File:Accordion chords-01.ogg|noicon]]
...using the code <code><nowiki>[[File:Accordion chords-01.ogg|noicon]]</nowiki></code>
And here's an example using a Wikimedia Commons video file in .ogg format:
[[File:Open research.ogg|thumb|left|160px|Open science]]
<br />&nbsp;<br />&nbsp;<br />
...using the code <code><nowiki>[[File:Open research.ogg|thumb|left|160px|Open science]]</nowiki></code>
<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />
For more information about the parameters you can use with audio and video files:
* Wikimedia Commons: [[commons:Commons:Video|Commons:Video]]
* Wikipedia: [https://en.wikipedia.org/wiki/Wikipedia:Extended_image_syntax#Multimedia_syntax Wikipedia:Extended image syntax#Multimedia syntax]
'''Templating'''
This wiki also includes [[Template:Listen]] for a more modular approach to embedding a sound file. Here's an example using the previously mentioned sound file, with the code to the right:
{{Listen
| filename    = Accordion chords-01.ogg
| title      = Accordion chords
| description = Chords being played on an accordion
| pos        = left
}}
<pre style="overflow: auto">
{{Listen
| filename    = Accordion chords-01.ogg
| title      = Accordion chords
| description = Chords being played on an accordion
| pos        = left
}}
</pre>
"But what is a template anyway?" you may ask. We'll talk more about templates in the [[Help:MediaWiki basics/Advanced training|advanced training]] section. Hopefully the above will make even more sense after that.
'''Troubleshooting'''
Some LIMSwiki articles include sound or video files, playable on almost all digital devices. However, your device must have the right software. If your computer or hand-held device does not automatically play these files when you click on them, downloading and installing applicable free software and codecs from the Internet will likely allow you to do so. [http://www.videolan.org/vlc/ VLC Player] is highly recommended for its open-source, non-profit status and its ability to handle most any file type. If you're still having difficulties, consulting Wikipedia's [https://en.wikipedia.org/wiki/Wikipedia:Media_help media help] section may prove useful.
===Tables===
If you haven't noticed, tables are used in many places throughout this wiki. Some tables are obvious, as found in the [[Vendor:LIMS vendor|LIMS vendor]] page. If you open that link in another tab, you'll notice several burly tables containing [[laboratory information management system]] (LIMS) vendors and their offerings. Other tables are not so obvious. Does the following look like a table?
{| cellspacing="0" cellpadding="0" style="margin:0em 0em 1em 0em; width:260px"
| style="width:90%; vertical-align:top; border:1px solid #aae6ef; background-color: Ivory;-moz-border-radius:10px; border-radius:10px;" rowspan="1"|
<div style="border-bottom:1px solid #aae6ef; background-color:#aae6ef; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;-moz-border-radius:10px 10px 0 0; border-radius:10px 10px 0 0;">Hi! I'm a table.</div>
<div style="padding:0.4em 1em 0.3em 1em;">
No, really! I'm a table! But I don't have:
* headers
* internal borders
* multiple columns and rows
</div>
|}
This is probably more what you were thinking of:
{| class="wikitable"
|-
  ! colspan="6" | Shopping List
|-
  | rowspan="2" | Cheese and<br />crackers
  | Brats
  | Buns
  | BBQ sauce
  | colspan="2" | Ice cream
|-
  | Wine
  | colspan="2" | Beer
  | Potato chips
  | Sriracha
|-
|}
Let's take a look at the code for that second table:
<pre>
{| class="wikitable"
|-
  ! colspan="6" | Shopping List
|-
  | rowspan="2" | Cheese and<br />crackers
  | Brats
  | Buns
  | BBQ sauce
  | colspan="2" | Ice cream
|-
  | Wine
  | colspan="2" | Beer
  | Potato chips
  | Sriracha
|-
|}
</pre>
Time to point out the important elements...
* You begin and end a table much like you do with links: an opening tag and a closing tag. In this case, the characters are <code><nowiki>{|</nowiki></code> and <code><nowiki>|}</nowiki></code>, the curly brace and the pipe.
* A default table "style" already exists in the wiki. To add the default style, you simply include <code>class="wikitable"</code> after the opening curly brace and pipe, same line.
* You can create headers with the ! character followed by the text you want in the header. For each column you want with a header, add an additional ! followed by text.
* You start and end a row with a pipe followed by a dash (|-). If a new row follows, you can reuse the previous pipe-dash combo. In the above example, each row of cells technically starts and ends with the <code>|-</code>.
* You start a new cell in that row with a pipe followed by a space and the stuff you want in the cell.
* You can span multiple columns and rows using the <code>colspan=</code> and <code>rowspan=</code> designators. Note the value is placed inside opening and closing quotes.
* Finally, if you modify the cell with something like <code>colspan=</code> or use the <code>style=</code> code to stylize the cell, you'll need to add a second pipe after those elements, followed by the desired content.
====Advanced tables====
Here's a slightly more complicated example for you to ponder over:
{| class="wikitable collapsible"
|-
  ! colspan="4"| SuperWidgets Product Price List
|-
  ! style="color:brown; background-color:#ffffee;"| License or add-on
  ! style="color:brown; background-color:#ffffee;"| Number of<br />concurrent users
  ! style="color:brown; background-color:#ffffee;"| Academic price
  ! style="color:brown; background-color:#ffffee;"| Private industrial price
|-
  | '''SuperWidgets full license Super 5'''
  | style="background-color:white;" align="center"| 5
  | style="background-color:white;" | €1200
  | style="background-color:white;" | €2100
|-
  | '''SuperWidgets full license Super 25'''
  | style="background-color:white;" align="center"| 25
  | style="background-color:white;" | €2300
  | style="background-color:white;" | €3800
|-
|}
And the code:
<pre>
{| class="wikitable collapsible"
|-
  ! colspan="4"| SuperWidgets Product Price List
|-
  ! style="color:brown; background-color:#ffffee;"| License or add-on
  ! style="color:brown; background-color:#ffffee;"| Number of<br />concurrent users
  ! style="color:brown; background-color:#ffffee;"| Academic price
  ! style="color:brown; background-color:#ffffee;"| Private industrial price
|-
  | '''SuperWidgets full license Super 5'''
  | style="background-color:white;" align="center"| 5
  | style="background-color:white;" | €1200
  | style="background-color:white;" | €2100
|-
  | '''SuperWidgets full license Super 25'''
  | style="background-color:white;" align="center"| 25
  | style="background-color:white;" | €2300
  | style="background-color:white;" | €3800
|-
|}
</pre>
A lot of that should look familiar after looking at the previous example. But some new elements were introduced, yes?
* The "collapsible" designator was added in the class quotation marks. This creates the "hide" link you see in the top header. This allows you to hide the rest of the table.
* Some CSS styling shows up in cells using the <code>style=</code> code, allowing finer control over the way a cell looks.
* The table features one grand column header spanning five columns, then in the next row there are four separate column headers, each preceded by the ! character.
For learning more about CSS and inline styles, visit [https://www.w3schools.com/css/css_howto.asp w3schools.com].
For more on tables and their parameters, see the [https://www.mediawiki.org/wiki/Help:Tables MediaWiki help page] on the topic.
==Intermediate exercise==
Let's put what you've learned in this training section to practice. You'll want to go to the sandbox you created on your profile page, where you've hopefully already completed the [[Help:MediaWiki basics/Beginner training#Beginner exercise|beginner exercise]].
1. Open your sandbox for editing. Read over your previously written material concerning your favorite subject in grade school or university. We're going to modify this content a bit.
2. After re-reading your content, think of what additional words, numbers, facts, multimedia, etc. you could add to your topic that would utilize what you learned from this training document. You may have to write a new paragraph, rearrange content, etc. See item three for the specifics of what you should be adding.
3. Integrate the following items into your existing content, modifying the text and its organization as needed:
* at least two examples of intermediate non-blockquote text formatting described on this page
* at least one blockquote of text; preferably use a quote from a book, journal, or web page with content relevant to your topic (use [http://books.google.com/ Google Books], [http://scholar.google.com/ Google Scholar], etc. if you need help)
* at least one relevant to semi-relevant image from [[commons:Main Page|Wikimedia Commons]] (WC); if you can't find such an image, choose the closest thing you can find from there
* a table with at least a header row, two normal rows, and three normal columns; use the class "wikitable" and at least one example of <code>colspan=</code> or <code>rowspan=</code>
* (optional) a WC sound or video file if applicable to your topic
4. Save your work. Also, ''note the exact source'' of the quote you pulled for this exercise. You're going to need that information for the [[Help:MediaWiki basics/Advanced training|advanced training]] exercise.
5. Go to [[User talk:Shawndouglas]], select "edit", and under your original header you started from the beginner exercise leave a comment stating you've completed the intermediate exercise. Be sure to sign your comment!
{{ombox
| type      = notice
| image    = [[Image:Blue check.svg|30px]]
| style    = width: 500px; margin: 4px 0%;
| text      = Ready to move on? Then head to [[Help:MediaWiki basics/Advanced training|the advanced training]] or go back to [[Help:MediaWiki basics/Beginner training|the beginner training]].<p></p>
}}
<!---Place all category tags here-->
[[Category:LIMSwiki training]]

Latest revision as of 19:18, 29 March 2024

Intermediate formatting in MediaWiki

Note: When opening links from wiki pages, right-click a link and choose to open it in a new tab. This should make navigating your way through the wiki less complex.

Text formatting revisited

In the beginner training guide we talked about simple text formatting methods like bolding and italicizing. Now let's cover a few more advanced ways to format your text.

Preformatted text

If you viewed the beginner training guide, you likely noticed several instances of gray boxes with wiki code and other text in them. How do you display that content like that without the system running any associated code? You do it by using the preformatted text tag <pre> to display the code without rendering it. For example, here is the code used to create that box at the top of this page, displayed (but not run) using the <pre> tag, the content, and then the closing </pre>:

{{ombox
| type      = notice
| style     = width: 960px;
| text      = This is intermediate training material for MediaWiki. If you still have problems after reviewing and practicing the material found here and in the [[Help:MediaWiki basics/Beginner training|beginner]] and [[Help:MediaWiki basics/Advanced training|advanced]] guides, you can request help on [[User_talk:Shawndouglas|this discussion page]].
}}

The code and nowiki tags

If you wish to show some sort of code inline, without the big block of gray, you can combine two HTML-style tags to create that effect: <code> and <nowiki>. For example, here's the same code from above but inline:

{{ombox | type = notice | style = width: 960px; | text = This is intermediate training material for MediaWiki. If you still have problems after reviewing and practicing the material found here and in the [[Help:MediaWiki basics/Beginner training|beginner]] and [[Help:MediaWiki basics/Advanced training|advanced]] guides, you can request help on [[User_talk:Shawndouglas|this discussion page]]. }}

We achieve that by doing the following:

<code><nowiki>
{{ombox
| type      = notice
| style     = width: 960px;
| text      = This is intermediate training material for MediaWiki. If you still have problems after reviewing and practicing the material found here and in the [[Help:MediaWiki basics/Beginner training|beginner]] and [[Help:MediaWiki basics/Advanced training|advanced]] guides, you can request help on [[User_talk:Shawndouglas|this discussion page]].
}}
</nowiki></code>

Essentially the <code> tag tells the system to show the text inline instead of in block format (like preformatted text), and the <nowiki> tag tells the system to not run that text as code but treat it as plain text.

Note: Leave <pre> for larger blocks. Using the described combination of <code> and <nowiki> tags is much better suited for small bits of code.

For example:

<code><nowiki>[[Help:MediaWiki basics/Beginner training|beginner training guide]]</nowiki></code>

...yields: [[Help:MediaWiki basics/Beginner training|beginner training guide]]

This may seem a bit confusing at first, but don't worry. You'll get the hang of this type of formatting.

Additional tags

Other HTML-based tags can be inserted into your wiki edits, though they should be used sparingly. Try to focus on using wiki-based formatting when possible.

  • Typewriter font: <tt>Typewriter font</tt>
  • Strike out or underline: <strike>Strike out</strike> or <u>underline</u>
  • X3, H2O: X<sup>3</sup>, H<sub>2</sub>O
  • The blockquote command will indent both margins when needed.

    <blockquote>The '''blockquote''' command will indent both margins when needed.</blockquote>

Including media

Images

There are a couple of ways to place images into wiki content: link to images from Wikimedia Commons or like to images uploaded to the wiki.

Wikimedia Commons

Wikimedia Commons (WC) is a "media file repository making available public domain and freely-licensed educational media content (images, sound and video clips) to everyone." LIMSwiki utilizes an extension which allows users to directly link to WC content using only the file name. Below is an example of such a link as well as the code to display it:

Sm-Wikipuzzlepiece.png ...and the code: [[File:Sm-Wikipuzzlepiece.png]]

Essentially you find an image you want to use on WC and place the name (File:Filename.format) between two opening and closing brackets (as you would an internal link). Of course, there are many additional parameters you can add to the image.

Sm-Wikipuzzlepiece.png

For example, you can float the image to the right.

The code: [[File:Sm-Wikipuzzlepiece.png|right]] ...and the image --->


You can also add a thumbnail border, specify the size, and add description text:

Description here


 

...and the code: [[File:Sm-Wikipuzzlepiece.png|thumb|left|80px|Description here]]


 
 
 

As seen in the code above, each parameter is separated by a pipe (|).

The most common parameters:

Type
"thumb" (or "thumbnail"; either can be followed by "=filename"), "frame" (or "framed"), or "frameless". Display the image with specific formatting.
Location
"right", "left", "center" or "none". Determine the horizontal placement of the image on the page. This defaults to "right" for thumbnails.
Alignment
"baseline", "middle", "sub", "super", "text-top", "text-bottom", "top", or "bottom". Vertically align the image with respect to adjacent text. This defaults to "middle".
Size
"Widthpx" or "xHeightpx" or "WidthxHeightpx". Scale the image to be no greater than the given width and/or height, keeping its aspect ratio.
Alt
Specify the alternate text for the image. This is intended to describe the image for visually impaired readers.

Covering all the parameters of image placement is beyond the scope of this training session. However, here are a couple of great sources for learning more about the parameters you can use with image files:

Uploaded image

In some cases an image you need to use isn't available on Wikimedia Commons (WC). In this case you can upload public domain and copyright-free images directly to the wiki. Once the upload is finished, the procedure for placing uploaded images into wiki pages is exactly the same as with WC content. You simply use the file name used for the wiki upload.

Other media

Sound and video files can also be embedded into a page. The formatting is similar to images in that you can simply use [[File:Filename.format]] plus applicable parameters.

Here's an example of a Wikimedia Commons sound file in .ogg format:

...using the code [[File:Accordion chords-01.ogg|noicon]]

And here's an example using a Wikimedia Commons video file in .ogg format:

Open science


 
 

...using the code [[File:Open research.ogg|thumb|left|160px|Open science]]


 
 
 

For more information about the parameters you can use with audio and video files:

Templating

This wiki also includes Template:Listen for a more modular approach to embedding a sound file. Here's an example using the previously mentioned sound file, with the code to the right:

{{Listen
| filename    = Accordion chords-01.ogg
| title       = Accordion chords
| description = Chords being played on an accordion
| pos         = left
}}

"But what is a template anyway?" you may ask. We'll talk more about templates in the advanced training section. Hopefully the above will make even more sense after that.

Troubleshooting

Some LIMSwiki articles include sound or video files, playable on almost all digital devices. However, your device must have the right software. If your computer or hand-held device does not automatically play these files when you click on them, downloading and installing applicable free software and codecs from the Internet will likely allow you to do so. VLC Player is highly recommended for its open-source, non-profit status and its ability to handle most any file type. If you're still having difficulties, consulting Wikipedia's media help section may prove useful.

Tables

If you haven't noticed, tables are used in many places throughout this wiki. Some tables are obvious, as found in the LIMS vendor page. If you open that link in another tab, you'll notice several burly tables containing laboratory information management system (LIMS) vendors and their offerings. Other tables are not so obvious. Does the following look like a table?

Hi! I'm a table.

No, really! I'm a table! But I don't have:

  • headers
  • internal borders
  • multiple columns and rows

This is probably more what you were thinking of:

Shopping List
Cheese and
crackers
Brats Buns BBQ sauce Ice cream
Wine Beer Potato chips Sriracha

Let's take a look at the code for that second table:

{| class="wikitable"
 |-
  ! colspan="6" | Shopping List
 |-
  | rowspan="2" | Cheese and<br />crackers
  | Brats
  | Buns
  | BBQ sauce
  | colspan="2" | Ice cream
 |-
  | Wine
  | colspan="2" | Beer
  | Potato chips
  | Sriracha
 |-
|}

Time to point out the important elements...

  • You begin and end a table much like you do with links: an opening tag and a closing tag. In this case, the characters are {| and |}, the curly brace and the pipe.
  • A default table "style" already exists in the wiki. To add the default style, you simply include class="wikitable" after the opening curly brace and pipe, same line.
  • You can create headers with the ! character followed by the text you want in the header. For each column you want with a header, add an additional ! followed by text.
  • You start and end a row with a pipe followed by a dash (|-). If a new row follows, you can reuse the previous pipe-dash combo. In the above example, each row of cells technically starts and ends with the |-.
  • You start a new cell in that row with a pipe followed by a space and the stuff you want in the cell.
  • You can span multiple columns and rows using the colspan= and rowspan= designators. Note the value is placed inside opening and closing quotes.
  • Finally, if you modify the cell with something like colspan= or use the style= code to stylize the cell, you'll need to add a second pipe after those elements, followed by the desired content.

Advanced tables

Here's a slightly more complicated example for you to ponder over:

SuperWidgets Product Price List
License or add-on Number of
concurrent users
Academic price Private industrial price
SuperWidgets full license Super 5 5 €1200 €2100
SuperWidgets full license Super 25 25 €2300 €3800

And the code:

{| class="wikitable collapsible"
 |-
  ! colspan="4"| SuperWidgets Product Price List
 |-
  ! style="color:brown; background-color:#ffffee;"| License or add-on
  ! style="color:brown; background-color:#ffffee;"| Number of<br />concurrent users
  ! style="color:brown; background-color:#ffffee;"| Academic price
  ! style="color:brown; background-color:#ffffee;"| Private industrial price
 |- 
  | '''SuperWidgets full license Super 5'''
  | style="background-color:white;" align="center"| 5
  | style="background-color:white;" | €1200
  | style="background-color:white;" | €2100
 |- 
  | '''SuperWidgets full license Super 25'''
  | style="background-color:white;" align="center"| 25
  | style="background-color:white;" | €2300
  | style="background-color:white;" | €3800
 |- 
|}

A lot of that should look familiar after looking at the previous example. But some new elements were introduced, yes?

  • The "collapsible" designator was added in the class quotation marks. This creates the "hide" link you see in the top header. This allows you to hide the rest of the table.
  • Some CSS styling shows up in cells using the style= code, allowing finer control over the way a cell looks.
  • The table features one grand column header spanning five columns, then in the next row there are four separate column headers, each preceded by the ! character.

For learning more about CSS and inline styles, visit w3schools.com.

For more on tables and their parameters, see the MediaWiki help page on the topic.

Intermediate exercise

Let's put what you've learned in this training section to practice. You'll want to go to the sandbox you created on your profile page, where you've hopefully already completed the beginner exercise.

1. Open your sandbox for editing. Read over your previously written material concerning your favorite subject in grade school or university. We're going to modify this content a bit.

2. After re-reading your content, think of what additional words, numbers, facts, multimedia, etc. you could add to your topic that would utilize what you learned from this training document. You may have to write a new paragraph, rearrange content, etc. See item three for the specifics of what you should be adding.

3. Integrate the following items into your existing content, modifying the text and its organization as needed:

  • at least two examples of intermediate non-blockquote text formatting described on this page
  • at least one blockquote of text; preferably use a quote from a book, journal, or web page with content relevant to your topic (use Google Books, Google Scholar, etc. if you need help)
  • at least one relevant to semi-relevant image from Wikimedia Commons (WC); if you can't find such an image, choose the closest thing you can find from there
  • a table with at least a header row, two normal rows, and three normal columns; use the class "wikitable" and at least one example of colspan= or rowspan=
  • (optional) a WC sound or video file if applicable to your topic

4. Save your work. Also, note the exact source of the quote you pulled for this exercise. You're going to need that information for the advanced training exercise.

5. Go to User talk:Shawndouglas, select "edit", and under your original header you started from the beginner exercise leave a comment stating you've completed the intermediate exercise. Be sure to sign your comment!