Template:Columns: Difference between revisions

No edit summary
m Removed background color to allow dynamic color shift in dark mode.
 
(49 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<includeonly><div class="pillars" style="column-count: {{{count|3}}}; text-align: left; {{{style|}}}; margin-bottom: 0.5em;">
  {{{1}}}
</div></includeonly><noinclude>
==Description==
==Description==
This template allows you to display content in multiple columns on a page. By default, it divides the content into three columns, but you can customize the number of columns by using the `count` parameter. Optionally, you can add custom inline styles using the `style` parameter to adjust the appearance of the columns.
This template allows you to display content in multiple columns on a page as a bulleted list.


==Usage==
==Usage==
To use this template, wrap the content you want to display in columns like this:
{| style="width: 100%; text-align: left; margin: auto;" class="wikitable"
 
|-
<pre>
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Default Usage</span><br><div style="text-align: left;"><span style="font-weight: normal;">When used with no additional parameters, the template will return a list split in 3 columns.</span></div>
|-
! width=25%|You Type
!You Get
|-
| style="text-align: left;" |<pre>
{{columns|
{{columns|
* Item 1
* Item 1
Line 16: Line 23:
}}
}}
</pre>
</pre>
 
|{{columns|
The above example will display the list in three columns by default.
* Item 1
 
* Item 2
===Parameters===
* Item 3
* `count` (optional): Specifies the number of columns. Defaults to 3 if not provided.
* Item 4
* `style` (optional): Additional inline CSS styles to apply to the container div.
* Item 5
 
* Item 6
===Example===
}}
To display the list in two columns, use the `count` parameter like this:
|-
 
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Count Parameter</span><br><div style="text-align: left;"><span style="font-weight: normal;">You can specify the number of columns in the output through use of the <code>count=</code> parameter.</span></div>
<pre>
|-
! width=25%|You Type
!You Get
|-
| style="text-align: left;" |<pre>
{{columns|count=2|
{{columns|count=2|
* Item 1
* Item 1
Line 36: Line 47:
}}
}}
</pre>
</pre>
|{{columns|count=2|
* Item 1
* Item 2
* Item 3
* Item 4
* Item 5
* Item 6
}}
|-
| style="text-align: left;" |<pre>
{{columns|count=4|
* Item 1
* Item 2
* Item 3
* Item 4
}}
</pre>
|{{columns|count=4|
* Item 1
* Item 2
* Item 3
* Item 4
}}
|-
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Style Parameter</span><br><div style="text-align: left;"><span style="font-weight: normal;">By passing the <code>style=</code> parameter, you can alter the appearance of the column container using various CSS attributes.<br><br><span style="font-size: 85%;">'''Note:''' The attributes used in the example below are a small selection of the possible attributes available. You can find more information on possible attributes [https://coding-help.fandom.com/wiki/Attributes#List_of_commonly_used_attributes here].</span></span></div>
|-
! width=25%|You Type
!You Get
|-
| style="text-align: left;" |<pre>
{{columns|
style=font-size: 150%; border: 1px solid #A2A7AF; background-color: #efefef; font-family: 'Libre Baskerville;|
* Item 1
* Item 2
* Item 3
* Item 4
* Item 5
* Item 6
}}
</pre>
|{{columns|style=font-size: 150%; border: 1px solid #A2A7AF; background-color: #efefef; font-family: 'Libre Baskerville;|
* Item 1
* Item 2
* Item 3
* Item 4
* Item 5
* Item 6
}}
|-
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Numbered List</span><br><div style="text-align: left;"><span style="font-weight: normal;">A numbered list can be used by replacing <code>*</code> with <code>#</code>.</span></div>
|-
! width=25%|You Type
!You Get
|-
| style="text-align: left;" |<pre>
{{columns|
# Item A
# Item B
# Item C
# Item D
# Item E
# Item F
}}
</pre>
|{{columns|
# Item A
# Item B
# Item C
# Item D
# Item E
# Item F
}}
|}


This will display the list in two columns.
== Articles Using Template ==
{{for|Special:WhatLinksHere/{{FULLPAGENAME}}|a full listing|here|pre=This list is limited to 100 pages}}
{{Special:WhatLinksHere/{{FULLPAGENAME}}|namespace=0|limit=100}}{{Special:WhatLinksHere/{{FULLPAGENAME}}|namespace=100|limit=100}}


</noinclude>
 
<div class="pillars" style="column-count: {{{count|3}}}; {{{style|}}};">
[[Category:Article Elements]]
  {{{1}}}
</div>