Template:Div col

From Everything Wiki
Jump to navigation Jump to search
0.00
(0 votes)

Script error: No such module "Check for unknown parameters".


Script error: No such module "Message box".

CSS3 multiple column layout
browser support
Internet
Explorer
Firefox Safari Chrome Opera
≤ 9 ≤ 1.0 ≤ 2 N/A ≤ 11.0
10
(2012)
≥ 1.5
(2005)
≥ 3
(2007)
≥ 1
(2008)
≥ 11.1
(2011)

{{Div col}}, together with {{div col end}}, is used to make a list into columns. It automatically breaks each column into an equal space, meaning, for instance, it isn't necessary to work out the halfway point between two columns. The template 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 parameter (|style=).

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

Usage[edit]

There are five parameters for this template and their usage is described below.

|cols= or first unnamed parameter
(Now 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))
Specifies the number of columns (default 2).
|colwidth= 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, about the width of a capital "M", e.g, colwidth=20em
|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.

Examples[edit]

Usage without parameters[edit]

Example with no parameters produces two columns as the default is two columns.

{{Div col}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
Script error: No such module "Check for unknown parameters".
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h


Usage with named parameters[edit]

When parameters are named in the template, they 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
Script error: No such module "Check for unknown parameters".
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

and exactly the same result below

Script error: No such module "Check for unknown parameters".
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h


Usage of parameters without naming the parameters[edit]

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 with correct usage of unnamed parameters

Note the empty column for the "number of columns" between "Div col" and "10em".

{{div col||10em|rules=yes|gap=2em|small=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{div col end}}
produces
Script error: No such module "Check for unknown parameters".
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h


Example with incorrect usage of unnamed parameters

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.

{{div col||10em|yes|2em|yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{div col end}}
produces (unnamed third, fourth and fifth parameters are ignored)
Script error: No such module "Check for unknown parameters".
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h


Usage of "col" parameter[edit]

Important tip: Use of now-deprecated "col" parameter is discouraged, leave it blank and instead use the "colwidth" parameter.

Example with 3 columns
{{Div col|3}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
Script error: No such module "Check for unknown parameters".
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
Example with 4 columns
{{Div col|4}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
Script error: No such module "Check for unknown parameters".
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

Usage of "colwidth" parameter[edit]

Important tip: Most wiki reviewers will reject the usage of previous parameter "col" and instead they prefer the use of this "col width" parameter i.e. it is strongly recommended to not use now-deprecated "col" parameter (please leave it blank) and instead use "col width" parameter.

Example with column width of 10em
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}}
produces
Script error: No such module "Check for unknown parameters".
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
Example with column width of 20em
{{div col||20em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{div col end}}
produces
Script error: No such module "Check for unknown parameters".
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
Example with column width of 30em
{{div col||30em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{div col end}}
produces
Script error: No such module "Check for unknown parameters".
  • 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||10em}}
a
b
c
d
e
f
g
h
{{div col end}}
produces
Script error: No such module "Check for unknown parameters".

a b c d e f g h

Usage of "rules" parameter[edit]

Example
{{Div col|rules=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
Script error: No such module "Check for unknown parameters".
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h


Usage of "gap" parameter[edit]

Example
{{Div col|colwidth=10em|rules=yes|gap=2em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
Script error: No such module "Check for unknown parameters".
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h


Usage of "small" parameter[edit]

Example showing how setting "small" parameter to "yes" produces smaller font size
{{Div col|small=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
Script error: No such module "Check for unknown parameters".
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

TemplateData[edit]

This is the TemplateData documentation for the template used by the new VisualEditor.

Div col <templatedata> {

"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 closed with .",

   "params": {
       "cols": {
           "label": "cols",
           "description": "Specifies the number of columns.",
           "type": "string",
           "default": "2",
           "aliases": ["1"],
           "required": false
       },
       "colwidth": {
           "label": "colwidth",
           "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.",
           "type": "string",
           "aliases": ["2"],
           "required": false
       },
       "rules": {
           "label": "rules",
           "description": "Produces vertical rules between the columns if set to yes.",
           "type": "string",
           "required": false
       },
       "gap": {
           "label": "gap",
           "description": "Specifies the space between the content of adjacent columns.",
           "type": "string",
           "required": false
       },
       "style": {
           "label": "style",
           "description": "Specifies any custom styling.",
           "type": "string",
           "required": false
       }
   }

} </templatedata>

Redirects[edit]


See also[edit]

Column-generating template families[edit]

This is the raw template for message boxes.
Use {{Mbox|title=Title here|content=Text here}} to use this template. The arguments bgcol and bordercol are also defined and accept hex color codes.

<section begin="table" />

Family Type
Handles wiki
 table code?File:Dagger-14-plain.png
Start template Column divider End template
"Col" Table Yes {{Col-begin}},
{{Col-begin-fixed}} or
{{Col-begin-small}}
{{Col-break}} or
{{Col-2}} .. {{Col-5}}
{{Col-end}}
"Col-float" CSS float Yes {{Col-float}} {{Col-float-break}} {{Col-float-end}}
"Columns" Table No {{Columns}}
"Columns-list" CSS columns Yes {{Columns-list}} (wrapper)
"Columns-start" CSS float Yes {{Columns-start}} {{Column}} {{Columns-end}}
"Div col" CSS columns 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 {{(!}}, {{!}}, {{!!}}, {{!-}}, {{!)}}) and/or HTML tags (<table>...</table>, <tr>...</tr>, etc.) will need to be used instead.<section end="table" />


es:Plantilla:Div col


You are not allowed to post comments.