Columns – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Add CSS fix)
(Add shrink parameter)
Line 1: Line 1:
<includeonly>{{#if:{{{1|}}}
<includeonly>{{#if:{{{1|}}}
| {{#if:{{{2|}}}
| {{#if:{{{2|}}}
| <div class="columns" style="column-count: {{{1|2}}}">{{{2|}}}</div>
| <div class="columns" style="column-count: {{{1|2}}}{{#if:{{{3|{{{shrink|}}}}}}|; display: inline-block}}">{{{2|}}}</div>
| -no columns content defined-
| -no columns content defined-
}}
}}
Line 11: Line 11:
|param2= content
|param2= content
|descr2= to be split in columns
|descr2= to be split in columns
|param3= shrink
|descr3= named parameter. makes the columns take the minimum width
|example1= <nowiki>{{Columns}}</nowiki>
|example1= <nowiki>{{Columns}}</nowiki>
|result1= {{Columns}}
|result1= {{Columns}}
Line 27: Line 29:
* contentD
* contentD
}}
}}
|example4= <div style="white-space: pre"><nowiki>{{Columns|3|
|example4= <div style="white-space: pre"><nowiki>{{Columns|2|
* contentA
* contentA
* contentB
* contentB
Line 33: Line 35:
* contentD
* contentD
}}</nowiki></div>
}}</nowiki></div>
|result4= {{Columns|3|
|result4= {{Columns|2|
* contentA
* contentA
* contentB
* contentB
Line 39: Line 41:
* contentD
* contentD
}}
}}
|example5= <div style="white-space: pre"><nowiki>{{Columns|3|
* contentA
* contentB
* contentC
* contentD
}}</nowiki></div>
|result5= {{Columns|3|
* contentA
* contentB
* contentC
* contentD
}}
|example6= <div style="white-space: pre"><nowiki>{{Columns|4|
* contentA
* contentB
* contentC
* contentD
}}</nowiki></div>
|result6= {{Columns|4|
* contentA
* contentB
* contentC
* contentD
}}
|example7= <div style="white-space: pre"><nowiki>{{Columns|3|
* contentA
* contentB
* contentC
* contentD
|shrink= y
}}</nowiki></div>
|result7= <div style="min-width: 50em">{{Columns|3|
* contentA
* contentB
* contentC
* contentD
|shrink= y
}}</div>
}}</noinclude>
}}</noinclude>

Revision as of 00:44, 8 August 2021

Creates CSS columns.

This template is used on these pages.

Usage

{{Columns|cols|content|shrink}}

  • cols: number of columns
  • content: to be split in columns
  • shrink: named parameter. makes the columns take the minimum width
Examples
Code Result
{{Columns}} -no columns count defined-
{{Columns|3}} -no columns content defined-
{{Columns|| * contentA * contentB * contentC * contentD }}
-no columns count defined-
{{Columns|2| * contentA * contentB * contentC * contentD }}
  • contentA
  • contentB
  • contentC
  • contentD
{{Columns|3| * contentA * contentB * contentC * contentD }}
  • contentA
  • contentB
  • contentC
  • contentD
{{Columns|4| * contentA * contentB * contentC * contentD }}
  • contentA
  • contentB
  • contentC
  • contentD
{{Columns|3| * contentA * contentB * contentC * contentD |shrink= y }}
  • contentA
  • contentB
  • contentC
  • contentD