This wiki is still a major work in progress, and a lot is being worked on. Please be patient.Newmaker

Difference between revisions of "Template:Compare"

From Petscop
Jump to: navigation, search
(nice)
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly><table class="wikitable" width="{{{width|}}}" style="text-align: center; margin-left: auto; margin-right: auto;">
 
<includeonly><table class="wikitable" width="{{{width|}}}" style="text-align: center; margin-left: auto; margin-right: auto;">
 
{{#if: {{{title|}}} | <caption>{{{title}}}</caption> |  }}
 
{{#if: {{{title|}}} | <caption>{{{title}}}</caption> |  }}
<tr><th {{#switch: {{{mode|horizontal}}} | vertical1 = | vertical2 = width="20%" | #default = width="50%"}} > {{#if: {{{leftt|}}} | {{{leftt}}} | Prototype }}</th>
+
<tr><th {{#switch: {{{mode|horizontal}}} | vertical1 = | vertical2 = width="20%" | #default = width="50%"}} > {{#if: {{{leftt|}}} | {{{leftt}}} | Original }}</th>
 
{{#switch: {{{mode|horizontal}}} | vertical1 =  </tr><tr> }}{{#switch: {{{mode|horizontal}}} | horizontal = | #default = <td style="text-align: {{{align|center}}};">{{{left}}}</td></tr><tr>}}
 
{{#switch: {{{mode|horizontal}}} | vertical1 =  </tr><tr> }}{{#switch: {{{mode|horizontal}}} | horizontal = | #default = <td style="text-align: {{{align|center}}};">{{{left}}}</td></tr><tr>}}
   <th {{#switch: {{{mode|horizontal}}} | vertical1 = | vertical2 = width="20%" | #default = width="50%"}} > {{#if: {{{rightt|}}} | {{{rightt}}} | Final }}</th>
+
   <th {{#switch: {{{mode|horizontal}}} | vertical1 = | vertical2 = width="20%" | #default = width="50%"}} > {{#if: {{{rightt|}}} | {{{rightt}}} | Brightened }}</th>
 
{{#switch: {{{mode|horizontal}}} | vertical2 = | #default = </tr><tr> }} {{#switch: {{{mode|horizontal}}} | horizontal = <td style="text-align: {{{align|center}}};vertical-align: {{{valign|middle}}};">{{{left}}}</td> }}
 
{{#switch: {{{mode|horizontal}}} | vertical2 = | #default = </tr><tr> }} {{#switch: {{{mode|horizontal}}} | horizontal = <td style="text-align: {{{align|center}}};vertical-align: {{{valign|middle}}};">{{{left}}}</td> }}
 
   <td style="text-align: {{{align|center}}};vertical-align: {{{valign|middle}}};">{{{right}}}</td></tr>
 
   <td style="text-align: {{{align|center}}};vertical-align: {{{valign|middle}}};">{{{right}}}</td></tr>
Line 10: Line 10:
  
 
==Overview==
 
==Overview==
''Compare'' is used for comparisons. Stolen from [https://tcrf.net/Template:Compare my other wiki].
+
''Compare'' is used for comparisons. Stolen from [https://tcrf.net/Template:Compare my other wiki]; refer to the documentation there.
 
+
[[Category:Formatting templates]]
Syntax:
 
<pre>{{compare
 
| width  = Specify the total width of the comparison table.
 
          Each side will use a different percentage of this based on the mode set.
 
| title  = Caption for the whole table (optional, defaults to blank)
 
| leftt  = Title of left column (this line is optional, defaults to "Prototype")
 
| rightt = Title of right column (this is also optional, defaults to "Final")
 
| left  = Content of the left box
 
| right  = Content of the right box
 
| mode  = ''mode'' can be set to the following:
 
          - ''horizontal'' for horizontal display. This is the standard display and ''mode''
 
              need not be set explicitly to this.
 
          - ''vertical1'' for vertical layout where Prototype is on top of Final version and
 
            the pictures below their description boxes.
 
          - ''vertical2'' for vertical layout where Prototype is on top of Final version and
 
            the pictures next to their description boxes.
 
| align  = If set, inline elements (text, img etc.) in content cells will be aligned to this value.
 
          It defaults to '''center''' if not set. Common values are '''left''' and '''right'''.
 
| valign = The same as align, but for aligning elements vertically. It defaults to '''middle''' if not set.
 
          Common values are '''top''' and '''bottom'''. Pointless with the vertical layout options.
 
}}</pre>
 
You can use <tt>leftt</tt> and <tt>rightt</tt> to change the titles of the two boxes, <tt>title</tt> to give it a caption, and <tt>width</tt> to specify the overall width.
 
 
 
== Layout options ==
 
 
 
Default horizontal layout ''horizontal'': (with and without caption, and with changed width respectively)
 
{{compare|title=Title}}
 
{{compare}}
 
{{compare|width=800}}
 
 
 
Alternative vertical layout ''vertical1'': (with and without caption, and with changed width respectively)
 
{{compare|mode=vertical1|title=Title}}
 
{{compare|mode=vertical1}}
 
{{compare|mode=vertical1|width=800}}
 
 
 
Alternative vertical layout ''vertical2'': (with and without caption, and with changed width respectively)
 
{{compare|mode=vertical2|title=Title}}
 
{{compare|mode=vertical2}}
 
{{compare|mode=vertical2|width=800}}
 
 
 
== Alignment options ==
 
 
 
''Left'' alignment:
 
{{compare|mode~horizontal|align=left}}
 
{{compare|mode=vertical1|align=left}}
 
{{compare|mode=vertical2|align=left}}
 
 
 
''Right'' alignment:
 
{{compare|mode~horizontal|align=right}}
 
{{compare|mode=vertical1|align=right}}
 
{{compare|mode=vertical2|align=right}}
 
 
 
Default ''center'' alignment:
 
{{compare|mode~horizontal|align=center}}
 
{{compare|mode=vertical1|align=center}}
 
{{compare|mode=vertical2|align=center}}
 
 
 
''Top'' vertical alignment:
 
{{compare|valign=top|right=[[File:TWW_OutsetIsland1.png|240px]]}}
 
 
 
''Bottom'' vertical alignment:
 
{{compare|valign=bottom|right=[[File:TWW_OutsetIsland1.png|240px]]}}
 
 
 
Default ''middle'' vertical alignment:
 
{{compare|valign=middle|right=[[File:TWW_OutsetIsland1.png|240px]]}}
 
 
 
[[Category:Templates]]
 
 
</noinclude>
 
</noinclude>

Latest revision as of 22:59, 17 November 2018

Contents

Overview

Compare is used for comparisons. Stolen from my other wiki; refer to the documentation there.