Columns – Template
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Fix alignment) |
Lou Montana (talk | contribs) (Replace shrink parameter with expand parameter) |
||
Line 1: | Line 1: | ||
<includeonly>{{#if:{{{1|}}} | <includeonly>{{#if:{{{1|}}} | ||
| {{#if:{{{2|}}} | | {{#if:{{{2|}}} | ||
| {{#if:{{{3|{{{ | | {{#if:{{{3|{{{expand|}}}}}}||<div>}}<div class="columns" style="column-count: {{{1|2}}}{{#if:{{{3|{{{expand|}}}}}}||; display: inline-block}}">{{{2|}}}</div>{{#if:{{{3|{{{expand|}}}}}}||</div>}} | ||
| -no columns content defined- | | -no columns content defined-{{TemplateCase||[[Category:Columns template usage error]]}} | ||
}} | }} | ||
| -no columns count defined- | | -no columns count defined-{{TemplateCase||[[Category:Columns template usage error]]}} | ||
}}</includeonly><noinclude>{{Doc/Template | }}</includeonly><noinclude>{{Doc/Template | ||
|descr= Creates CSS columns. | |descr= Creates CSS columns. It also adds the page to the [[:Category:Columns template usage error|Columns template usage error]] category on usage error. | ||
|param1= cols | |param1= cols | ||
|descr1= number of columns | |descr1= number of columns | ||
|param2= content | |param2= content | ||
|descr2= to be split in columns | |descr2= to be split in columns, usually a list | ||
|param3= | |param3= expand | ||
|descr3= named parameter. makes the columns take the | |descr3= named parameter. makes the columns take the whole width | ||
|example1= <nowiki>{{Columns}}</nowiki> | |example1= <nowiki>{{Columns}}</nowiki> | ||
|result1= {{Columns}} | |result1= {{Columns}} | ||
Line 70: | Line 70: | ||
* contentC | * contentC | ||
* contentD | * contentD | ||
| | |expand= y | ||
}}Below</nowiki></div> | }}Below</nowiki></div> | ||
|result7= <div style="min-width: 50em">Above{{Columns|3| | |result7= <div style="min-width: 50em">Above{{Columns|3| | ||
Line 77: | Line 77: | ||
* contentC | * contentC | ||
* contentD | * contentD | ||
| | |expand= y | ||
}}Below</div> | }}Below</div> | ||
}}</noinclude> | }}</noinclude> |
Revision as of 13:41, 22 May 2022
Creates CSS columns. It also adds the page to the Columns template usage error category on usage error.
This template is used on these pages.
Usage
{{Columns|cols|content|expand}}
- cols: number of columns
- content: to be split in columns, usually a list
- expand: named parameter. makes the columns take the whole 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
|expand= y
}}Below
|
Above
|