Dungeons and Dragons Wiki:Tables
Wiki Syntax |
Tables look complicated, don't they? Don't worry, for the most part they are either created for you via templates or the following summary of simple tables will give you all you will probably need to make tables in Wikis. If not, there are a few of us who know wiki markup who can assist you. You can find us in IRC.
Basic SyntaxEdit
Basic tables have a starting line that contains special properties, followed by an optional caption, followed by table rows, and finally ends with a table closing line. By the end of reading this, you should have the rudimentary ability to look up the chart and copy things as needed, and with practice, you won't be needing the chart at all.
Starting LineEdit
Tables start with a {|
followed by optional parameters. These optional parameters are HTML.
Parameter | What it does, Usage |
---|---|
class="d20 zebra" |
This sets up hooks for styling the table. Specifically, it sets two classes that our CSS files know of: d20 and zebra. If you want to see what they do, try making a table without one or both of them. |
border="0" |
Use this when you want to remove a border. Change 0 to 1 if you want to add a border. Higher values make thicker borders, but are discouraged on this wiki. |
style="text-align:left;" |
This will left-align your text for the entire table. If you know CSS, this allows any CSS to be used. |
CaptionEdit
If you really want to give your table a caption, and we encourage you to do so, you use |+ Caption here
. The caption has to occur right after the starting line. Do not put it at the bottom or randomly in the table. It won't show up.
Table Rows, Headers, and ContentEdit
Every table row begins with |-
. If you have a caption, this is the next line after it. If you do not, this is the line after the starting row. Sure, it is technically optional for the first row, but better more verbose than less. Since these precede content, you do not place |-
before the table closing line.
After stating a table row, the next line should start with either !
for a table header or a |
for table data. Table headers are automatically bold, and should only be used in headers, which means the first line usually, though if the table is long, the table header line may be placed multiple times.
After a table data or header, if you want more than one column, and you probably do, you want to use double the character you used to designate the first as a table header or row. So if you want a second table header, use !!
and for table data, use ||
. See the sample table for what this looks like with content.
Ending LineEdit
The ending line should come after a content row, not a table row designator. To end a table, use |}
. Anything directly after it is put on its own new line, and treated as normal wiki markup.
ExampleEdit
As an example, the following table is a modified version of the table above, mainly to add a caption.
{| class="d20 zebra" style="text-align:left;" |+ Common Table Parameters |- ! ParameterĀ !! What it does, Usage |- |<code>class="d20 zebra"</code> || This sets up hooks for styling the table. Specifically, it sets two classes that our CSS files know of: ''d20'' and ''zebra''. If you want to see what they do, try making a table without one or both of them. |- |<code>border="0"</code> || Use this when you want to remove a border. Change ''0'' to ''1'' if you want to add a border. Higher values make thicker borders, but are discouraged on this wiki. |- |<code>style="text-align:left;"</code> || This will left-align your text for the entire table. If you know CSS, this allows any CSS to be used. |}
Parameter | What it does, Usage |
---|---|
class="d20 zebra" |
This sets up hooks for styling the table. Specifically, it sets two classes that our CSS files know of: d20 and zebra. If you want to see what they do, try making a table without one or both of them. |
border="0" |
Use this when you want to remove a border. Change 0 to 1 if you want to add a border. Higher values make thicker borders, but are discouraged on this wiki. |
style="text-align:left;" |
This will left-align your text for the entire table. If you know CSS, this allows any CSS to be used. |
Summarizing TableEdit
Function | Markup | When to use |
---|---|---|
Start Table | {| |
Beginning of table |
Parameters | parameterName="value" |
After Start Table markup on Start Table line |
Caption | |+ Caption Text |
After Start Table line |
New Table Row | |- |
Before rows containing table datas & headers |
Table Header | ! Header OneĀ !! Header Two |
First table row |
Table Data | | Data One || Data Two |
Other table rows |
Close Table | |} |
After law table row |
Complicated Tables or How To Edit Class TablesEdit
To be done...eventually.