Difference between revisions of "Template: Columns"

From A Wiki of Ice and Fire
Jump to: navigation, search
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><div style="-moz-column-count:{{{count|2}}}; -webkit-column-count:{{{count|2}}}; column-count:{{{count|2}}}; {{#if: {{{style|}}}|{{{style}}} }}">{{{data}}}</div></includeonly><noinclude>
+
<includeonly>{{#if: {{{count|}}}{{{style|}}}{{{colwidth|}}}
 +
| <div style="
 +
{{#if:{{{count|}}}|-moz-column-count:{{{count}}}; -webkit-column-count:{{{count}}}; column-count:{{{count}}};}}
 +
{{#if:{{{colwidth|}}}|-moz-column-width:{{{colwidth}}}; -webkit-column-width:{{{colwidth}}}; column-width:{{{colwidth}}};}}
 +
{{{style|}}}">
 +
{{{data|{{{content|}}}}}}</div> <!-- New line is necessary to properly render wiki markup -->
 +
| <div style="-moz-column-count:{{{1}}}; -webkit-column-count:{{{1}}}; column-count:{{{1}}};">  
 +
{{{2}}}</div>}}</includeonly><noinclude>
 +
Divides list or text into columns automatically(no need to count and dived into table cells and then re-count and re-dived if new info is added to the list).
  
Divides long list for you, no need to count and dived into table cells.
+
Usage, <nowiki>{{Columns|# of columns| list or text}}</nowiki>
 
+
For example if you need to break the list bellow into 3 columns:
==Usage==
 
<pre>{{Columns|count=2|data =
 
...
 
your text/list/etc
 
...
 
}}</pre>
 
 
 
 
 
for example this list  
 
 
* 1
 
* 1
 
* 2  
 
* 2  
Line 17: Line 16:
 
* 4  
 
* 4  
 
* 5  
 
* 5  
* 6
+
* 6  
 
 
  
with count=2 will look like:
+
Simply type:
{{Columns|count=2|data=
+
<pre>{{Columns|2|
 
* 1
 
* 1
 
* 2  
 
* 2  
Line 27: Line 25:
 
* 4  
 
* 4  
 
* 5  
 
* 5  
* 6
+
* 6
}}
+
}}</pre>
 
 
  
with count=3 will look like:
+
Result:
{{Columns|count=3|data=
+
{{Columns|2|
 
* 1
 
* 1
 
* 2  
 
* 2  
Line 38: Line 35:
 
* 4  
 
* 4  
 
* 5  
 
* 5  
* 6
+
* 6
 
}}
 
}}
  
 
+
For additional options/parameters use this: (If needed more functionalities will be added
Advanced/optional parameter, {{{style}}} for css styles.
+
<pre>{{Columns|count=2
[[Category:Templates]]</noinclude>
+
|style=css style (color/width/text fonts,size etc.)
 +
|data =
 +
...
 +
your text/list/etc
 +
...
 +
}}</pre>
 +
[[Category:Templates]]
 +
</noinclude>

Revision as of 21:53, 1 September 2018

Divides list or text into columns automatically(no need to count and dived into table cells and then re-count and re-dived if new info is added to the list).

Usage, {{Columns|# of columns| list or text}} For example if you need to break the list bellow into 3 columns:

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

Simply type:

{{Columns|2|
* 1
* 2 
* 3 
* 4 
* 5 
* 6
}}

Result:

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

For additional options/parameters use this: (If needed more functionalities will be added

{{Columns|count=2
|style=css style (color/width/text fonts,size etc.)
|data =
...
your text/list/etc
...
}}