Template:Table Row - 1

From War Commander Wiki
Jump to navigation Jump to search
Template documentation (for the above template, sometimes hidden or invisible)
Description
This template is used to insert a row into an already defined table.
Syntax
{{Table Row - 1|<Text1>|<Text2>}} or use the short version {{TR|<Text1>|<Text2>}}.
Accepts up to 10 total unnamed arguments.

Parameters

  • In most cases, only unnamed parameters are used.
  • First unnamed parameter is required (rest are optional).
Numbered parameters
Set text of cells.
rowspann
(i.e. rowspan1, rowspan2, etc.) sets rowspan attribute for each cell (default value = 1).

Example 1

Code:

{| class="wikitable" style="width:100%; text-align:center;"
{{Table Header - 1| Title 1|Title 2|Title 3}}
{{Table Row - 1| Text 1|Text 2|Text 3}}
|}

Output:

Title 1 Title 2 Title 3
Text 1
Text 2
Text 3

Example 2

Code:

{| class="wikitable" style="width:100%;"
{{TH|Title 1|Title 2|Title 3|Title 4|Title 5|rowspan1=2|rowspan2=2|rowspan3=2|rowspan4=2|colspan5=4}}
{{TH|Sub-title 1|Sub-title 2|Sub-title 3|Sub-title 4}}
{{TR|a|b|c| |||   |d}}
|}

Output:

Title 1 Title 2 Title 3 Title 4 Title 5
Sub-title 1 Sub-title 2 Sub-title 3 Sub-title 4
a
b
c




d

Best Practice

To edit or experience with this template, use it's sandbox and testcases pages:

  1. The /sandbox may not have the latest version of the template code in it, so before you make a change, you need to synchronize it with the main template. Copy the entire contents of the main template to the /sandbox subpage, and save the page. Your edit summary should be something like "synchronize with the main template", or simply "sync".
  2. Have fun editing the sandbox. When you have some code you want to test, save the page.
  3. If you have added any new features or changed any parameters, you should add new test cases to the /testcases subpage so that they can be tested. Also, bear in mind that the existing test cases may not be complete. It's okay to rewrite the test cases if they aren't useful for what you're trying to achieve, but also consider editors who may use the test cases after you.
  4. Purge the /testcases page to update the results.
  5. Verify that the test case results are correct. If everything looks good, copy the code from the sandbox to the main template.

Related Templates

{{Table Header - 1}}
Used to define header row of a table.