Class Three

From TalossaWiki
Revision as of 06:04, 8 July 2012 by AD (talk | contribs)
Jump to navigation Jump to search

In this, the last class, we will learn how to create tables, as well as how to use some templates. Both of these things are very versatile, but can get very complicated. Even though you won't be a master of the subject when we finish, you should know enough to use basic tables and templates - and perhaps you'll be interested enough to keep learning on your own!

Tables

You're probably familiar with tables - a way of showing data arranged into columns and rows. They can be a useful way of working through options, and can even be helpful in making decisions. Here is a table, for example, about when it is a good idea to order a pizza:

Are you already eating a pizza? Then you should...
No Order a pizza, immediately.
Yes Order a second pizza.

On the wiki, tables are used for a lot of things. They can get really complicated, so we'll just learn how to make one simple kind of table for now.

All tables begin with a {| and end with a |}. If you forget either of those sets of symbols, then the table will not work correctly. It's also important to remember that the {| must be at the start of a new line. If you try to start a table in the middle of a line, then it doesn't work.

So the first thing we do is lay out our table start and table end:

<code>{|

|}</code>

Now we have to add some data. We'll start with the simplest possible table: one cell of information. To build a cell, you just start with a pipe symbol, and then put in whatever information you want. All cells must start with a pipe symbol.

<code>{|
|Pizza
|}</code>

Now, this is a boring table. It's so boring, you actually can't even tell it's a table. Here it is:

Pizza

We can make it a little better - make it actually look like a table - if we tell the table to look different. We can do that by instructing it to look like a "wikitable," which is a standard and very common style of table. To do that, you just add class="wikitable" right after the table start. It's a sort of code word: that one little command is actually just the trigger for a whole bunch of hidden instructions, cached away elsewhere on the wiki.

So our table now looks like this in code:

<code>{| class="wikitable"
|Pizza
|}</code>

And that gives us this:

Pizza

Still very boring, but a little more like a table. Let's add a header.

Templates

Variables

Userboxes