Columns – Template
| Lou Montana (talk | contribs)  (Add shrink parameter) | Lou Montana (talk | contribs)  m (Fix alignment) | ||
| Line 1: | Line 1: | ||
| <includeonly>{{#if:{{{1|}}} | <includeonly>{{#if:{{{1|}}} | ||
| | {{#if:{{{2|}}} | | {{#if:{{{2|}}} | ||
| 	| <div class="columns" style="column-count: {{{1|2}}}{{#if:{{{3|{{{shrink|}}}}}}|; display: inline-block}}">{{{2|}}}</div> | 	| {{#if:{{{3|{{{shrink|}}}}}}|<div>}}<div class="columns" style="column-count: {{{1|2}}}{{#if:{{{3|{{{shrink|}}}}}}|; display: inline-block}}">{{{2|}}}</div>{{#if:{{{3|{{{shrink|}}}}}}|</div>}} | ||
| 	| -no columns content defined- | 	| -no columns content defined- | ||
| }} | }} | ||
| Line 65: | Line 65: | ||
| * contentD | * contentD | ||
| }} | }} | ||
| |example7= <div style="white-space: pre"><nowiki>{{Columns|3| | |example7= <div style="white-space: pre"><nowiki>Above{{Columns|3| | ||
| * contentA | * contentA | ||
| * contentB | * contentB | ||
| Line 71: | Line 71: | ||
| * contentD | * contentD | ||
| |shrink= y | |shrink= y | ||
| }}</nowiki></div> | }}Below</nowiki></div> | ||
| |result7= <div style="min-width: 50em">{{Columns|3| | |result7= <div style="min-width: 50em">Above{{Columns|3| | ||
| * contentA | * contentA | ||
| * contentB | * contentB | ||
| Line 78: | Line 78: | ||
| * contentD | * contentD | ||
| |shrink= y | |shrink= y | ||
| }}</div> | }}Below</div> | ||
| }}</noinclude> | }}</noinclude> | ||
Revision as of 00:26, 11 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
| 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
}} | 
 | 
| {{Columns|3|
* contentA
* contentB
* contentC
* contentD
}} | 
 | 
| {{Columns|4|
* contentA
* contentB
* contentC
* contentD
}} | 
 | 
| Above{{Columns|3|
* contentA
* contentB
* contentC
* contentD
|shrink= y
}}Below | Above 
 | 
