Template:Compare

From Chrono Compendium
Jump to: navigation, search

Overview

Compare is used for comparisons.

Syntax:

{{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.
| float = ''float'' can be set to the following:
           - ''center'' for the box to be aligned in the center of the page. This is the standard display and ''float''
               need not be set explicitly to this.
           - ''left'' for the box to be aligned to the left side of the article.
           - ''right'' for the box to be aligned to the right side of the article.
}}

You can use leftt and rightt to change the titles of the two boxes, title to give it a caption, and width to specify the overall width.

Layout options

Default horizontal layout horizontal: (with and without caption, and with changed width respectively)

{{#if: Title | | }} {{#switch: horizontal | vertical1 = }}{{#switch: horizontal | horizontal = | #default = }} {{#switch: horizontal | vertical2 = | #default = }} {{#switch: horizontal | horizontal = }}
Title
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}
{{#if: | | }} {{#switch: horizontal | vertical1 = }}{{#switch: horizontal | horizontal = | #default = }} {{#switch: horizontal | vertical2 = | #default = }} {{#switch: horizontal | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}
{{#if: | | }} {{#switch: horizontal | vertical1 = }}{{#switch: horizontal | horizontal = | #default = }} {{#switch: horizontal | vertical2 = | #default = }} {{#switch: horizontal | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}

Alternative vertical layout vertical1: (with and without caption, and with changed width respectively)

{{#if: Title | | }} {{#switch: vertical1 | vertical1 = }}{{#switch: vertical1 | horizontal = | #default = }} {{#switch: vertical1 | vertical2 = | #default = }} {{#switch: vertical1 | horizontal = }}
Title
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}
{{#if: | | }} {{#switch: vertical1 | vertical1 = }}{{#switch: vertical1 | horizontal = | #default = }} {{#switch: vertical1 | vertical2 = | #default = }} {{#switch: vertical1 | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}
{{#if: | | }} {{#switch: vertical1 | vertical1 = }}{{#switch: vertical1 | horizontal = | #default = }} {{#switch: vertical1 | vertical2 = | #default = }} {{#switch: vertical1 | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}

Alternative vertical layout vertical2: (with and without caption, and with changed width respectively)

{{#if: Title | | }} {{#switch: vertical2 | vertical1 = }}{{#switch: vertical2 | horizontal = | #default = }} {{#switch: vertical2 | vertical2 = | #default = }} {{#switch: vertical2 | horizontal = }}
Title
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}
{{#if: | | }} {{#switch: vertical2 | vertical1 = }}{{#switch: vertical2 | horizontal = | #default = }} {{#switch: vertical2 | vertical2 = | #default = }} {{#switch: vertical2 | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}
{{#if: | | }} {{#switch: vertical2 | vertical1 = }}{{#switch: vertical2 | horizontal = | #default = }} {{#switch: vertical2 | vertical2 = | #default = }} {{#switch: vertical2 | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}

Alignment options

Left alignment:

{{#if: | | }} {{#switch: horizontal | vertical1 = }}{{#switch: horizontal | horizontal = | #default = }} {{#switch: horizontal | vertical2 = | #default = }} {{#switch: horizontal | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}
{{#if: | | }} {{#switch: vertical1 | vertical1 = }}{{#switch: vertical1 | horizontal = | #default = }} {{#switch: vertical1 | vertical2 = | #default = }} {{#switch: vertical1 | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}
{{#if: | | }} {{#switch: vertical2 | vertical1 = }}{{#switch: vertical2 | horizontal = | #default = }} {{#switch: vertical2 | vertical2 = | #default = }} {{#switch: vertical2 | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}

Right alignment:

{{#if: | | }} {{#switch: horizontal | vertical1 = }}{{#switch: horizontal | horizontal = | #default = }} {{#switch: horizontal | vertical2 = | #default = }} {{#switch: horizontal | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}
{{#if: | | }} {{#switch: vertical1 | vertical1 = }}{{#switch: vertical1 | horizontal = | #default = }} {{#switch: vertical1 | vertical2 = | #default = }} {{#switch: vertical1 | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}
{{#if: | | }} {{#switch: vertical2 | vertical1 = }}{{#switch: vertical2 | horizontal = | #default = }} {{#switch: vertical2 | vertical2 = | #default = }} {{#switch: vertical2 | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}

Default center alignment:

{{#if: | | }} {{#switch: horizontal | vertical1 = }}{{#switch: horizontal | horizontal = | #default = }} {{#switch: horizontal | vertical2 = | #default = }} {{#switch: horizontal | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}
{{#if: | | }} {{#switch: vertical1 | vertical1 = }}{{#switch: vertical1 | horizontal = | #default = }} {{#switch: vertical1 | vertical2 = | #default = }} {{#switch: vertical1 | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}
{{#if: | | }} {{#switch: vertical2 | vertical1 = }}{{#switch: vertical2 | horizontal = | #default = }} {{#switch: vertical2 | vertical2 = | #default = }} {{#switch: vertical2 | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}

Top vertical alignment:

{{#if: | | }} {{#switch: horizontal | vertical1 = }}{{#switch: horizontal | horizontal = | #default = }} {{#switch: horizontal | vertical2 = | #default = }} {{#switch: horizontal | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}240px

Bottom vertical alignment:

{{#if: | | }} {{#switch: horizontal | vertical1 = }}{{#switch: horizontal | horizontal = | #default = }} {{#switch: horizontal | vertical2 = | #default = }} {{#switch: horizontal | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}240px

Default middle vertical alignment:

{{#if: | | }} {{#switch: horizontal | vertical1 = }}{{#switch: horizontal | horizontal = | #default = }} {{#switch: horizontal | vertical2 = | #default = }} {{#switch: horizontal | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}240px

Float options

Default center float:

{{#if: | | }} {{#switch: horizontal | vertical1 = }}{{#switch: horizontal | horizontal = | #default = }} {{#switch: horizontal | vertical2 = | #default = }} {{#switch: horizontal | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}

Left float:

{{#if: | | }} {{#switch: horizontal | vertical1 = }}{{#switch: horizontal | horizontal = | #default = }} {{#switch: horizontal | vertical2 = | #default = }} {{#switch: horizontal | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}

Right float:

{{#if: | | }} {{#switch: horizontal | vertical1 = }}{{#switch: horizontal | horizontal = | #default = }} {{#switch: horizontal | vertical2 = | #default = }} {{#switch: horizontal | horizontal = }}
{{{title}}}
{{#if: | {{{leftt}}} | Prototype }}
{{{left}}}
{{#if: | {{{rightt}}} | Final }}
{{{left}}}{{{right}}}