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"
(nice) |
(lets make this better for here) |
||
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}}} | | + | <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}}} | | + | <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 17: | Line 17: | ||
Each side will use a different percentage of this based on the mode set. | Each side will use a different percentage of this based on the mode set. | ||
| title = Caption for the whole table (optional, defaults to blank) | | title = Caption for the whole table (optional, defaults to blank) | ||
− | | leftt = Title of left column (this line is optional, defaults to " | + | | leftt = Title of left column (this line is optional, defaults to "Original") |
− | | rightt = Title of right column (this is also optional, defaults to " | + | | rightt = Title of right column (this is also optional, defaults to "Brightened") |
| left = Content of the left box | | left = Content of the left box | ||
| right = Content of the right box | | right = Content of the right box |
Revision as of 23:53, 15 November 2018
Overview
Compare is used for comparisons. Stolen from my other wiki.
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 "Original") | rightt = Title of right column (this is also optional, defaults to "Brightened") | 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. }}
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)
Original | Brightened |
---|---|
{{{left}}} | {{{right}}} |
Original | Brightened |
---|---|
{{{left}}} | {{{right}}} |
Original | Brightened |
---|---|
{{{left}}} | {{{right}}} |
Alternative vertical layout vertical1: (with and without caption, and with changed width respectively)
Original |
---|
{{{left}}} |
Brightened |
{{{right}}} |
Original |
---|
{{{left}}} |
Brightened |
{{{right}}} |
Original |
---|
{{{left}}} |
Brightened |
{{{right}}} |
Alternative vertical layout vertical2: (with and without caption, and with changed width respectively)
Original | {{{left}}} |
---|---|
Brightened | {{{right}}} |
Original | {{{left}}} |
---|---|
Brightened | {{{right}}} |
Original | {{{left}}} |
---|---|
Brightened | {{{right}}} |
Alignment options
Left alignment:
Original | Brightened |
---|---|
{{{left}}} | {{{right}}} |
Original |
---|
{{{left}}} |
Brightened |
{{{right}}} |
Original | {{{left}}} |
---|---|
Brightened | {{{right}}} |
Right alignment:
Original | Brightened |
---|---|
{{{left}}} | {{{right}}} |
Original |
---|
{{{left}}} |
Brightened |
{{{right}}} |
Original | {{{left}}} |
---|---|
Brightened | {{{right}}} |
Default center alignment:
Original | Brightened |
---|---|
{{{left}}} | {{{right}}} |
Original |
---|
{{{left}}} |
Brightened |
{{{right}}} |
Original | {{{left}}} |
---|---|
Brightened | {{{right}}} |
Top vertical alignment:
Original | Brightened |
---|---|
{{{left}}} | 240px |
Bottom vertical alignment:
Original | Brightened |
---|---|
{{{left}}} | 240px |
Default middle vertical alignment:
Original | Brightened |
---|---|
{{{left}}} | 240px |