Difference between revisions of "Template:ContentCell"

From MechWarrior: Living Legends Wiki
Jump to: navigation, search
(Add doc)
m (Left-right padding adjustments)
 
Line 1: Line 1:
 
<includeonly>|style="{{#if: {{{1|}}}|width:{{{1}}};|}}" class="notice metadata plainlinks contentcell"|{{#if: {{{2|}}}|
 
<includeonly>|style="{{#if: {{{1|}}}|width:{{{1}}};|}}" class="notice metadata plainlinks contentcell"|{{#if: {{{2|}}}|
<div class="titlebar">{{#if: {{{link|}}}|[{{{link}}} {{{2}}}]|{{{2}}} }}</div>}}<div style="padding-left: 1em;">
+
<div class="titlebar">{{#if: {{{link|}}}|[{{{link}}} {{{2}}}]|{{{2}}} }}</div>}}<div style="padding: 0px 1em;">
 
{{#ifeq: {{{3|}}}||{{:Main Page/{{#replace: {{#replace: {{{2}}}|]|}}|[|}} }}|{{{3}}}}}
 
{{#ifeq: {{{3|}}}||{{:Main Page/{{#replace: {{#replace: {{{2}}}|]|}}|[|}} }}|{{{3}}}}}
 
</div>{{#if: {{{4|}}}|
 
</div>{{#if: {{{4|}}}|
<div class="titlebar">{{#if: {{{link2|}}}|[{{{link2}}} {{{4}}}]|{{{4}}} }} </div><div style="padding-left: 1em;">
+
<div class="titlebar">{{#if: {{{link2|}}}|[{{{link2}}} {{{4}}}]|{{{4}}} }} </div><div style="padding: 0px 1em;">
 
{{#ifeq: {{{5|}}}||{{:Main Page/{{#replace: {{#replace: {{{4}}}|]|}}|[|}} }}|{{{5}}}}}
 
{{#ifeq: {{{5|}}}||{{:Main Page/{{#replace: {{#replace: {{{4}}}|]|}}|[|}} }}|{{{5}}}}}
 
</div>}}{{#if: {{{6|}}}|
 
</div>}}{{#if: {{{6|}}}|
<div class="titlebar">{{#if: {{{link3|}}}|[{{{link3}}} {{{6}}}]|{{{6}}} }} </div><div style="padding-left: 1em;">
+
<div class="titlebar">{{#if: {{{link3|}}}|[{{{link3}}} {{{6}}}]|{{{6}}} }} </div><div style="padding: 0px 1em;">
 
{{#ifeq: {{{7|}}}||{{:Main Page/{{#replace: {{#replace: {{{6}}}|]|}}|[|}} }}|{{{7}}}}}
 
{{#ifeq: {{{7|}}}||{{:Main Page/{{#replace: {{#replace: {{{6}}}|]|}}|[|}} }}|{{{7}}}}}
 
</div>}}</includeonly><noinclude>{{Documentation}}</noinclude>
 
</div>}}</includeonly><noinclude>{{Documentation}}</noinclude>

Latest revision as of 00:25, 27 October 2017

Documentation icon Template documentation[view] [edit] [history] [purge]

This template creates table cells, such as on the Main page. Centralizing them into a template allows for global editing of the style in the template without having to edit multiple locations on a page.
When using the longer parameters, such as a large amount of content, they can be spread across several lines as in example 2.

NOTE: This template must be enclosed within braces to create a table as shown.

Example 1
{| style="width:100%;"
{{ContentCell|70%|title 1|Content 1|title 2|Content 2}}
{{ContentCell||title 1|Content 1|title 2|Content 2|title 3|Content 3}}
|}
Example 2
{| style="width:100%;"
{{ContentCell|70%|title 1|
Content 1
|title 2|
Content 2
}}
{{ContentCell||title 1|Content 1|title 2|Content 2|title 3|Content 3}}
|}
Both Result In