Difference between revisions of "Template:Div col/doc"

From blackwiki
Jump to navigation Jump to search
(redundant)
imported>Izno
(tstyles)
 
(57 intermediate revisions by 28 users not shown)
Line 1: Line 1:
 +
{{Documentation subpage}}
 
<!-----------------------------------------------------------------------------
 
<!-----------------------------------------------------------------------------
 
   PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE
 
   PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE
 
  ------------------------------------------------------------------------------>
 
  ------------------------------------------------------------------------------>
{{Documentation subpage}}
+
{{#ifeq:{{FULLPAGENAME}}|Template:Div col|{{High-use| 269676 }}|{{#ifeq:{{FULLPAGENAME}}|Template:Div col end|{{High-use| 209292 }}}}}}
{{Ombox |type=notice |text=Columns are not supported by some older browsers, most notably Internet Explorer 9 and below and Opera 11.0 and below. See [[Template:Reflist#Browser support for columns|this page]] for more information.}}
+
{{Ombox |type=notice |text=Columns are not supported by some older browsers, most notably Internet Explorer 9 and earlier and Opera 11.0 and earlier. See {{section link|Template:Reflist#Browser support for columns}} for more information.}}
 
{{CSS3 multiple column layout}}
 
{{CSS3 multiple column layout}}
 +
{{Lua|Module:Check for unknown parameters}}
 +
{{Uses TemplateStyles|Template:Div col/styles.css}}
 +
 +
{{tl|Div col}} formats a list into columns that wrap properly and compatibly with portable computer devices, especially PAD operating systems and small screens.
  
{{tl|Div col}} can be used to make a list into columns that wraps properly and compatibly with portble computer devices, esp. PAD operating systems and small screens. It automatically breaks each column into an equal space, meaning, for instance, it is not necessary to work out the halfway point, or the on-third & two-thirds points between two columns.
+
==Purpose==
* The list content is either provided by the {{para|content}} parameter (which can be restrictive of what content is allowed; e.g., wiki markup like {{!}} must somehow be escaped) or terminated with {{tl|div col end}}. The {{tl|columns-list}} wrapper uses the {{para|content}} parameter.
+
It automatically breaks the available screen space into equal parts, meaning, for instance, that it is not necessary to guess how many columns to use and then figure out the dividing point(s), e.g., the halfway point to divide the list into two columns, or the one-third and two-thirds points to divide the list into three columns.
* The template system (family) also offers parameter options to set a smaller (90%) font-size parameter ({{para|small|yes}}), place vertical lines parameter ("rules") between the columns ({{para|rules}}) and to add other custom styling parameter ({{para|style}}).
+
* The list content is either provided by the {{para|content}} parameter (which can be restrictive of what content is allowed; e.g., wiki markup such as the {{!}} character must somehow be escaped), or terminated with {{tl|div col end}}. The {{tl|columns-list}} wrapper uses the parameter method for providing content (including its limitations).
 +
* The template system (family) also offers parameter options to set a smaller (90%) font-size parameter ({{para|small|yes}}), place vertical lines parameter ("rules") between the columns ({{para|rules}}) and to add other custom styling ({{para|style}}).
  
{{tl|Div col}} can create multiple columns in [[web browser]]s which support one of the following [[CSS]] properties:
+
{{tl|Div col}} can create multiple columns in [[web browser]]s which support the following [[CSS]] properties:
* ''column-count'' (for [[Cascading Style Sheets#CSS 3|CSS3]]-compliant browsers; see [http://www.w3.org/TR/css3-multicol/ CSS3 module: Multi-column layout])
+
* ''column-width'' (for [[Cascading Style Sheets#CSS 3|CSS3]]-compliant browsers; see [http://www.w3.org/TR/css3-multicol/ CSS3 module: Multi-column layout])
* ''-moz-column-count'' (for [[Mozilla application framework|Mozilla]]/[[Gecko (layout engine)|Gecko]]-based browsers such as [[Firefox]])
 
* ''-webkit-column-count'' (for [[WebKit]]-based browsers such as [[Safari (web browser)|Safari]] and [[Google Chrome]])
 
 
   
 
   
==Usage==
+
By default, the template creates columns that are [[Em (typography)|30em]] wide.
There are six parameters for this template and their usage is described below.
+
 
; {{s|{{para|cols}}}} {{nobold|or first unnamed parameter}} : ''(Now [[Deprecation|deprecated]],  as ''colwidth'' below is better suited to flexible formatting for a variety of display screen sizes (from mobile phones, tablets, etc to widescreen cinema-style displays))''<br/>Specifies the number of columns (default 2).
+
==This template's parameters==
; {{para|colwidth}} {{nobold|or second unnamed parameter}} : Specifies the minimum width of the columns and determines automatically the number of columns based on screen width (i.e. more columns will be shown on wider displays). Overrides ''cols''. Specified in any CSS unit, for instance in [[Em (typography)|em]], about the width of a capital "M", e.g, <code>colwidth=20em</code>
+
===Descriptions===
 +
There are six parameters for this template:  
 +
; {{para|colwidth}} : Specifies the minimum width of the columns so that the number of columns is automatically based on screen width (that is, more columns will be shown on wider displays). Can be specified in any [[CSS#Length units|CSS unit of measure]], for instance, the [[Em (typography)|em]] (about the width of the capital "M" of the displayed typeface), e.g., <code>colwidth=20em</code>. If no value is supplied, the template uses a default of 30em.
 
; {{para|rules}} : Adds vertical lines ("rules") between the columns if set to <code>yes</code> or some CSS styling (e.g. <code>1px dashed blue;</code>).  
 
; {{para|rules}} : Adds vertical lines ("rules") between the columns if set to <code>yes</code> or some CSS styling (e.g. <code>1px dashed blue;</code>).  
 
; {{para|gap}} : Specifies the space between the content of adjacent columns. Specified in any CSS unit, e.g, <code>gap=2em</code>. The default spacing (set by browser) is 1em.
 
; {{para|gap}} : Specifies the space between the content of adjacent columns. Specified in any CSS unit, e.g, <code>gap=2em</code>. The default spacing (set by browser) is 1em.
 
; {{para|style}} : [[Cascading Style Sheets|CSS styling]] to apply to the columns.
 
; {{para|style}} : [[Cascading Style Sheets|CSS styling]] to apply to the columns.
 +
; {{para|small|yes}} : sets font size to 90%.
 
; {{para|content}} : content to apply to the columns.
 
; {{para|content}} : content to apply to the columns.
  
==Examples==
+
===Example of "colwidth" parameter===
 
+
; Example with column width of 10em
===Usage without parameters===
 
Example with no parameters produces two columns as the default is two columns.
 
 
<pre>
 
<pre>
{{Div col}}
+
{{div col|colwidth=10em}}
 
* a
 
* a
 
* b
 
* b
Line 38: Line 43:
 
* g
 
* g
 
* h
 
* h
{{Div col end}}
+
{{div col end}}
 
</pre>
 
</pre>
 
; produces:
 
; produces:
{{Div col}}
+
{{Div col|colwidth=10em}}
 
* a
 
* a
 
* b
 
* b
Line 52: Line 57:
 
{{Div col end}}
 
{{Div col end}}
  
 
+
===Example of "rules" parameter===
===Usage with named parameters===
+
; Example:
When parameters are named in the template, they can be used in any order.
 
'''Example: '''
 
 
<pre>
 
<pre>
{{Div col|colwidth=10em|rules=yes|gap=2em|small=yes}}
+
{{Div col|colwidth=10em|rules=yes}}
 
* a
 
* a
 
* b
 
* b
Line 68: Line 71:
 
{{Div col end}}
 
{{Div col end}}
 
</pre>
 
</pre>
or
+
; produces:
<pre>
+
{{Div col|colwidth=10em|rules=yes}}
{{Div col|rules=yes|gap=2em|small=yes|colwidth=10em}}
 
 
* a
 
* a
 
* b
 
* b
Line 80: Line 82:
 
* h
 
* h
 
{{Div col end}}
 
{{Div col end}}
</pre>
+
 
; produces:
+
===Example of "gap" parameter===
{{Div col|colwidth=10em|rules=yes|gap=2em|small=yes}}
+
; Example:
 +
<pre>
 +
{{Div col|colwidth=10em|rules=yes|gap=2em}}
 
* a
 
* a
 
* b
 
* b
Line 92: Line 96:
 
* h
 
* h
 
{{Div col end}}
 
{{Div col end}}
and exactly the same result below
+
</pre>
{{Div col|rules=yes|gap=2em|small=yes|colwidth=10em}}
+
; produces:
 +
{{Div col|colwidth=10em|rules=yes|gap=2em}}
 
* a
 
* a
 
* b
 
* b
Line 104: Line 109:
 
{{Div col end}}
 
{{Div col end}}
  
===Usage of parameters without naming the parameters===
+
===Example of "small" parameter===
When parameters are not named then template considers first unnamed parameter to be "col", second unnamed parameter to be "colwidth", remaining unnamed parameters (e.g. third, fourth, fifth, etc unnamed parameter) will be ignored by the template without providing an error message. The first and second parameter "col" and "colwidth" could be unnamed but all other parameters (such as "rules", "gap", "style" and "small") must always be named in the template.     
+
; Example showing how setting "small" parameter to "yes" produces smaller font size (90% of the size that would otherwise be displayed)
;Example with correct usage of unnamed parameters
 
Note the empty column for the "number of columns" between "Div col" and "10em".
 
 
<pre>
 
<pre>
{{div col||10em|rules=yes|gap=2em|small=yes}}
+
{{Div col|small=yes}}
 
* a
 
* a
 
* b
 
* b
Line 118: Line 121:
 
* g
 
* g
 
* h
 
* h
{{div col end}}
+
{{Div col end}}
 
</pre>
 
</pre>
; produces
+
; produces:
{{div col||10em|rules=yes|gap=2em|small=yes}}
+
{{Div col|small=yes}}
 
* a
 
* a
 
* b
 
* b
Line 132: Line 135:
 
{{Div col end}}
 
{{Div col end}}
  
 
+
===Example of "content" parameter===
;Example with incorrect usage of unnamed parameters
+
; Example showing how to provide "content" parameter without using {{tlx|Div col end}}
Note that the unnamed third, fourth and fifth parameters will be ignored by the template. If used, then
 
third, fourth and fifth parameters must always be named.
 
 
<pre>
 
<pre>
{{div col||10em|yes|2em|yes}}
+
{{Div col|colwidth=10em|content=
 
* a
 
* a
 
* b
 
* b
Line 146: Line 147:
 
* g
 
* g
 
* h
 
* h
{{div col end}}
+
}}
 
</pre>
 
</pre>
; produces (unnamed third, fourth and fifth parameters are ignored)
+
; produces:
{{div col||10em|yes|2em|yes}}
+
{{Div col|colwidth=10em|content=
 
* a
 
* a
 
* b
 
* b
Line 158: Line 159:
 
* g
 
* g
 
* h
 
* h
{{Div col end}}
+
}}
  
 
+
===Usage with multiple parameters===
===Usage of "col" parameter===
+
Parameters can be used in any order.  
Important tip: Use of now-[[Deprecation|deprecated]] "col" parameter is discouraged, leave it blank and instead use the "colwidth" parameter.
+
'''Example: '''
 
; Example with 3 columns
 
 
<pre>
 
<pre>
{{Div col|3}}
+
{{Div col|colwidth=10em|rules=yes|gap=2em|small=yes}}
 
* a
 
* a
 
* b
 
* b
Line 177: Line 176:
 
{{Div col end}}
 
{{Div col end}}
 
</pre>
 
</pre>
; produces:
+
or
{{Div col|3}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
 
 
; Example with 4 columns
 
 
<pre>
 
<pre>
{{Div col|4}}
+
{{Div col|rules=yes|gap=2em|small=yes|colwidth=10em}}
 
* a
 
* a
 
* b
 
* b
Line 203: Line 190:
 
</pre>
 
</pre>
 
; produces:
 
; produces:
{{Div col|4}}
+
{{Div col|colwidth=10em|rules=yes|gap=2em|small=yes}}
 
* a
 
* a
 
* b
 
* b
Line 213: Line 200:
 
* h
 
* h
 
{{Div col end}}
 
{{Div col end}}
 
+
and exactly the same result below
===Usage of "colwidth" parameter===
+
{{Div col|rules=yes|gap=2em|small=yes|colwidth=10em}}
Important tip: Most wiki reviewers will reject the usage of previous parameter "col" and instead they prefer the use of this "colwidth" parameter i.e. it is strongly recommended to not use now-[[Deprecation|deprecated]] "col" parameter (please leave it blank) and instead use "colwidth" parameter. 
 
; Example with column width of 10em
 
<pre>
 
Note the empty column for the "number of columns" between "Div col" and "10em".
 
{{div col||10em}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{div col end}}
 
</pre>
 
; produces:
 
{{Div col||10em}}
 
 
* a
 
* a
 
* b
 
* b
Line 244: Line 214:
 
; Example with column width of 20em
 
; Example with column width of 20em
 
<pre>
 
<pre>
{{div col||20em}}
+
{{div col|colwidth=20em}}
 
* a
 
* a
 
* b
 
* b
Line 256: Line 226:
 
</pre>
 
</pre>
 
; produces:
 
; produces:
{{Div col||20em}}
+
{{Div col|colwidth=20em}}
 
* a
 
* a
 
* b
 
* b
Line 269: Line 239:
 
; Example with column width of 30em
 
; Example with column width of 30em
 
<pre>
 
<pre>
{{div col||30em}}
+
{{div col|colwidth=30em}}
 
* a
 
* a
 
* b
 
* b
Line 281: Line 251:
 
</pre>
 
</pre>
 
; produces:
 
; produces:
{{Div col||30em}}
+
{{Div col|colwidth=30em}}
 
* a
 
* a
 
* b
 
* b
Line 294: Line 264:
 
; Example of how this template behaves if no [[•|bullets]] (generated by asterisk mark) are used.   
 
; Example of how this template behaves if no [[•|bullets]] (generated by asterisk mark) are used.   
 
<pre>
 
<pre>
{{div col||10em}}
+
{{div col|colwidth=10em}}
 
a
 
a
 
b
 
b
Line 306: Line 276:
 
</pre>
 
</pre>
 
; produces:
 
; produces:
{{Div col||10em}}
+
{{Div col|colwidth=10em}}
 
a
 
a
 
b
 
b
Line 317: Line 287:
 
{{Div col end}}
 
{{Div col end}}
  
===Usage of "rules" parameter===
+
==Tracking categories==
; Example:
+
* {{category link with count|Pages using div col with unknown parameters}} (for erroneous use of parameter names not documented here)
<pre>
+
* {{category link with count|Pages using div col with small parameter}}
{{Div col|rules=yes}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
</pre>
 
; produces:
 
{{Div col|rules=yes}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
 
 
 
 
===Usage of "gap" parameter===
 
; Example:
 
<pre>
 
{{Div col|colwidth=10em|rules=yes|gap=2em}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
</pre>
 
; produces:
 
{{Div col|colwidth=10em|rules=yes|gap=2em}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
 
 
 
 
===Usage of "small" parameter===
 
; Example showing how setting "small" parameter to "yes" produces smaller font size
 
<pre>
 
{{Div col|small=yes}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
</pre>
 
; produces:
 
{{Div col|small=yes}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
 
 
===Usage of "content" parameter===
 
; Example showing how to provide "content" parameter without using {{tlx|Div col end}}
 
<pre>
 
{{Div col|colwidth=10em|content=
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
}}
 
</pre>
 
; produces:
 
{{Div col|colwidth=10em|content=
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
}}
 
  
 
==TemplateData==
 
==TemplateData==
{{TemplateDataHeader}}
+
{{TemplateData header}}
 
{{#switch: {{BASEPAGENAME}}
 
{{#switch: {{BASEPAGENAME}}
 
|Div col=<templatedata>
 
|Div col=<templatedata>
Line 430: Line 298:
 
"description": "Breaks a list into columns. It automatically breaks each column to an equal space, so you do not manually have to find the half way point on two columns. The list is provided by |content= or closed with {{div col end}}.",
 
"description": "Breaks a list into columns. It automatically breaks each column to an equal space, so you do not manually have to find the half way point on two columns. The list is provided by |content= or closed with {{div col end}}.",
 
"params": {
 
"params": {
"cols": {
 
"label": "cols",
 
"description": "Specifies the number of columns.",
 
"type": "number",
 
"default": "2",
 
"aliases": [
 
"1"
 
],
 
"required": false,
 
"deprecated": "Use colwidth parameter instead, so that the layout resizes according to the screen"
 
},
 
 
"colwidth": {
 
"colwidth": {
"label": "colwidth",
+
"label": "Column width",
"description": "Specifies the width of columns, and determines dynamically the number of columns based on screen width; more columns will be shown on wider displays. This overrides the 'cols' setting.",
+
"description": "Specifies the width of columns, and determines dynamically the number of columns based on screen width; more columns will be shown on wider displays.",
 
"type": "string",
 
"type": "string",
"aliases": [
+
"example": "30em"
"2"
 
],
 
"required": false
 
 
},
 
},
 
"rules": {
 
"rules": {
"label": "rules",
+
"label": "Rules",
 
"description": "Produces vertical rules between the columns if set to yes.",
 
"description": "Produces vertical rules between the columns if set to yes.",
 
"type": "string",
 
"type": "string",
"required": false
+
"example": "'yes' or '1px dashed blue'"
 
},
 
},
 
"gap": {
 
"gap": {
"label": "gap",
+
"label": "Gap size",
 
"description": "Specifies the space between the content of adjacent columns.",
 
"description": "Specifies the space between the content of adjacent columns.",
 
"type": "string",
 
"type": "string",
"required": false
+
"example": "2em"
 
},
 
},
 
"style": {
 
"style": {
"label": "style",
+
"label": "CSS style",
 
"description": "Specifies any custom styling.",
 
"description": "Specifies any custom styling.",
"type": "string",
+
"type": "string"
"required": false
 
 
},
 
},
 
"content": {
 
"content": {
"label": "content",
+
"label": "Content",
"description": "Specifies the content.",
+
"description": "Specifies the content to divide into columns",
 +
"type": "string"
 +
},
 +
"small": {
 +
"label": "Small font",
 +
"description": "Use a smaller font size (90%)",
 +
"example": "yes",
 
"type": "string",
 
"type": "string",
"required": false
+
"default": "no"
 
}
 
}
 
}
 
}
Line 488: Line 347:
 
==Redirects==
 
==Redirects==
 
{{#ifeq:{{ROOTPAGENAME}}|Div col|
 
{{#ifeq:{{ROOTPAGENAME}}|Div col|
 +
* {{Tlx|Col div}}
 +
* {{Tlx|Colbegin}}  (but '''not''' {{Tlx|Col begin}} or {{Tlx|Col-begin}})
 +
* {{Tlx|Cols}}
 
* {{Tlx|Div col start}}
 
* {{Tlx|Div col start}}
* {{Tlx|Colbegin}} (but '''not''' {{Tlx|Col begin}})
+
* {{Tlx|Div col begin}}
* {{Tlx|Cols}}
+
* {{Tlx|Div-col}}
 +
* {{Tlx|Palmares start}}
 
}}
 
}}
 
{{#ifeq:{{ROOTPAGENAME}}|Div col end|
 
{{#ifeq:{{ROOTPAGENAME}}|Div col end|
Line 506: Line 369:
 
{{Column-generating template families}}
 
{{Column-generating template families}}
  
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox |
+
<includeonly>{{Sandbox other|
 
| <!-- CATEGORIES BELOW THIS LINE, PLEASE: -->
 
| <!-- CATEGORIES BELOW THIS LINE, PLEASE: -->
 
[[Category:Multi-column templates]]
 
[[Category:Multi-column templates]]
 
+
[[Category:Templates that add a tracking category]]
 
<!--?:-->{{#switch:{{PAGENAME}} |Div col= |Div col end=}}
 
<!--?:-->{{#switch:{{PAGENAME}} |Div col= |Div col end=}}
[[es:Plantilla:Div col]]
 
 
}}</includeonly>
 
}}</includeonly>

Latest revision as of 20:50, 16 December 2020

CSS3 multiple-column layout browser support
Property Internet
Explorer
Firefox Safari Chrome Opera
column-width
column-count
≥ 10
(2012)
≥ 1.5
(2005)
≥ 3
(2007)
≥ 1
(2008)
≥ 11.1
(2011)
columns ≥ 10
(2012)
≥ 9
(2011)
≥ 3
(2007)
≥ 1
(2008)
≥ 11.1
(2011)
break-before
break-after
break-inside
≥ 10
(2012)
≥ 65
(2019)
≥ 10
(2016)
≥ 65
(2016)
≥ 15
(2013)

Script error: No such module "Uses TemplateStyles".

{{Div col}} formats a list into columns that wrap properly and compatibly with portable computer devices, especially PAD operating systems and small screens.

Purpose

It automatically breaks the available screen space into equal parts, meaning, for instance, that it is not necessary to guess how many columns to use and then figure out the dividing point(s), e.g., the halfway point to divide the list into two columns, or the one-third and two-thirds points to divide the list into three columns.

  • The list content is either provided by the |content= parameter (which can be restrictive of what content is allowed; e.g., wiki markup such as the | character must somehow be escaped), or terminated with {{div col end}}. The {{columns-list}} wrapper uses the parameter method for providing content (including its limitations).
  • The template system (family) also offers parameter options to set a smaller (90%) font-size parameter (|small=yes), place vertical lines parameter ("rules") between the columns (|rules=) and to add other custom styling (|style=).

{{Div col}} can create multiple columns in web browsers which support the following CSS properties:

By default, the template creates columns that are 30em wide.

This template's parameters

Descriptions

There are six parameters for this template:

|colwidth= 
Specifies the minimum width of the columns so that the number of columns is automatically based on screen width (that is, more columns will be shown on wider displays). Can be specified in any CSS unit of measure, for instance, the em (about the width of the capital "M" of the displayed typeface), e.g., colwidth=20em. If no value is supplied, the template uses a default of 30em.
|rules= 
Adds vertical lines ("rules") between the columns if set to yes or some CSS styling (e.g. 1px dashed blue;).
|gap= 
Specifies the space between the content of adjacent columns. Specified in any CSS unit, e.g, gap=2em. The default spacing (set by browser) is 1em.
|style= 
CSS styling to apply to the columns.
|small=yes 
sets font size to 90%.
|content= 
content to apply to the columns.

Example of "colwidth" parameter

Example with column width of 10em
{{div col|colwidth=10em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{div col end}}
produces
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

Example of "rules" parameter

Example
{{Div col|colwidth=10em|rules=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

Example of "gap" parameter

Example
{{Div col|colwidth=10em|rules=yes|gap=2em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

Example of "small" parameter

Example showing how setting "small" parameter to "yes" produces smaller font size (90% of the size that would otherwise be displayed)
{{Div col|small=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

Example of "content" parameter

Example showing how to provide "content" parameter without using {{Div col end}}
{{Div col|colwidth=10em|content=
* a
* b
* c
* d
* e
* f
* g
* h
}}
produces
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

Usage with multiple parameters

Parameters can be used in any order. Example:

{{Div col|colwidth=10em|rules=yes|gap=2em|small=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}

or

{{Div col|rules=yes|gap=2em|small=yes|colwidth=10em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

and exactly the same result below

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
Example with column width of 20em
{{div col|colwidth=20em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{div col end}}
produces
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
Example with column width of 30em
{{div col|colwidth=30em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{div col end}}
produces
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
Example of how this template behaves if no bullets (generated by asterisk mark) are used.
{{div col|colwidth=10em}}
a
b
c
d
e
f
g
h
{{div col end}}
produces

a b c d e f g h

Tracking categories

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Div col

Breaks a list into columns. It automatically breaks each column to an equal space, so you do not manually have to find the half way point on two columns. The list is provided by |content= or closed with {{div col end}}.

Template parameters

ParameterDescriptionTypeStatus
Column widthcolwidth

Specifies the width of columns, and determines dynamically the number of columns based on screen width; more columns will be shown on wider displays.

Example
30em
Stringoptional
Rulesrules

Produces vertical rules between the columns if set to yes.

Example
'yes' or '1px dashed blue'
Stringoptional
Gap sizegap

Specifies the space between the content of adjacent columns.

Example
2em
Stringoptional
CSS stylestyle

Specifies any custom styling.

Stringoptional
Contentcontent

Specifies the content to divide into columns

Stringoptional
Small fontsmall

Use a smaller font size (90%)

Default
no
Example
yes
Stringoptional

Redirects


See also

Column-generating template families

<section begin="table" />

Family Type
Handles wiki
 table code?File:Dagger-14-plain.png
Responsive/
Mobile suited
Start template Column divider End template
"Col" Table Yes Yes {{Col-begin}},
{{Col-begin-fixed}} or
{{Col-begin-small}}
{{Col-break}} or
{{Col-2}} .. {{Col-5}}
{{Col-end}}
"Col-float" CSS float Yes Yes {{Col-float}} {{Col-float-break}} {{Col-float-end}}
"Columns" Table No Yes {{Columns}}
"Columns-list" CSS columns Yes Yes {{Columns-list}} (wrapper)
"Columns-start" CSS float Yes Yes {{Columns-start}} {{Column}} {{Columns-end}}
"Flex columns" CSS flexbox Yes Yes {{Flex columns}}
"Div col" CSS columns Yes Yes {{Div col}} {{Div col end}}

File:Dagger-14-plain.png I.e., can the columns handle the wiki markup {| | || |- |} used to create tables? If not, templates that produce these elements (such as {{(!}}, {{!}}, {{!!}}, {{!-}}, {{!)}}) or HTML tags (<table>...</table>, <tr>...</tr>, etc.) will need to be used instead.<section end="table" />