Difference between revisions of "Template:Ai"

From Data JW United
Jump to navigation Jump to search
(Tree items)
 
(29 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
This is used for creating pages with pagination.
+
<code><ai></code> - stands for "align items". Used for horizontaly align items. Usages examples: aligning items used in the header or footer of a page.  
= Top left =
+
= One item =
<nowiki><code>{{page|tf|50}}</code></nowiki>
+
== Align left ==
{{page|tf|50|Content}}
+
<code><nowiki>{{ai|1|l|Content}}</nowiki></code>
= Top right =  
+
<div style="background: #f3efef; max-width: 200px">{{ai|1|l|content}}</div>
<nowiki><code>{{page|tr|50}}</code></nowiki>
+
== Align center ==
{{page|tr|50|content}}
+
<code><nowiki>{{ai|1|c|Content}}</nowiki></code>
= Bottom center =
+
<div style="background: #f3efef; max-width: 200px">{{ai|1|c|content}}</div>
<nowiki><code>{{page|bc|50}}</code></nowiki>
+
== Align right ==
{{page|bc|50|content}}
+
<code><nowiki>{{ai|1|r|Content}}</nowiki></code>
= Bottom left =
+
<div style="background: #f3efef; max-width: 200px">{{ai|1|r|content}}</div>
<nowiki><code>{{page|bf|50}}</code></nowiki>
+
= Two items =
{{page|bf|50|content}}
+
<code><nowiki>{{ai|2|first|second}}</nowiki></code>
= Bottom right =
+
<div style="background: #f3efef; max-width: 200px">{{ai|2|first|second}}</div>
<nowiki><code>{{page|br|50}}</code></nowiki>
+
= Tree items =
{{page|br|50|content}}
+
<code><nowiki>{{ai|3|first|second|third}}</nowiki></code>
 
+
<div style="background: #f3efef; max-width: 200px">{{ai|3|first|second|third}}</div>
 +
== Other cases ==
 +
<code><nowiki>{{ai|3|Watchtower|{{ta|r|23}}}}</nowiki></code>
 +
<div style="background: #f3efef; max-width: 200px">{{ai|3||Watchtower|{{ta|r|23}}}}</div>
 
</noinclude>
 
</noinclude>
 
+
<includeonly>{{#ifeq: {{{1}}} |1| {{#ifeq: {{{2}}} |l| <div>{{{3}}}</div> }}{{#ifeq: {{{2}}} |c| <div style="text-align:center;">{{{3}}}</div> }} {{#ifeq: {{{2}}} |r| <div style="text-align:right;">{{{3}}}</div> }} }} {{#ifeq: {{{1}}} |2| <div style="display:flex"><div style="flex:1">{{{2}}}</div><div style="flex:1;text-align:right">{{{3}}}</div></div> }} {{#ifeq: {{{1}}} |3| <div style="display:flex;justify-content:space-between;"><div style="flex:1">{{{2}}}</div><div style="flex:2;text-align:center;">{{{3}}}</div><div style="flex:1;text-align:right">{{{4}}}</div></div> }}</includeonly>
<includeonly>
 
{{#ifeq: {{{1}}} |tf| tf }}
 
{{#ifeq: {{{1}}} |tr| tr }}
 
{{#ifeq: {{{1}}} |br| br }}
 
{{#ifeq: {{{1}}} |bl| bl }}
 
{{#ifeq: {{{1}}} |bc| bc }}
 
</includeonly>
 

Latest revision as of 05:55, 6 October 2020

<ai> - stands for "align items". Used for horizontaly align items. Usages examples: aligning items used in the header or footer of a page.

One item

Align left

{{ai|1|l|Content}}

content

Align center

{{ai|1|c|Content}}

content

Align right

{{ai|1|r|Content}}

content

Two items

{{ai|2|first|second}}

first
second

Tree items

{{ai|3|first|second|third}}

first
second
third

Other cases

{{ai|3|Watchtower|{{ta|r|23}}}}

Watchtower
23