Шаблон:Div col/док — разлика између измена

Iz Vojne Enciklopedije
Пређи на навигацију Пређи на претрагу
(+)
 
Нема описа измене
Ред 1: Ред 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|Шаблон:Div col/styles.css}}


{{tl|Div col}}, together with {{tl|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 options to set a smaller (90%) font-size ({{para|small|yes}}), place vertical lines ("rules") between the columns ({{para|rules}}) and to add other custom styling ({{para|style}}).
The '''div col''' (short for division columns) formats a list into columns that wrap at multiple screen resolutions responsively. 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.


{{tl|Div col}} can create multiple columns in [[web browser]]s which support one of the following [[CSS]] properties:
==This template's parameters==
* ''column-count'' (for [[Cascading Style Sheets#CSS 3|CSS3]]-compliant browsers; see [http://www.w3.org/TR/css3-multicol/ CSS3 module: Multi-column layout])
===Descriptions===
* ''-moz-column-count'' (for [[Mozilla application framework|Mozilla]]/[[Gecko (layout engine)|Gecko]]-based browsers such as [[Firefox]])
There are six parameters for this template:
* ''-webkit-column-count'' (for [[WebKit]]-based browsers such as [[Safari (web browser)|Safari]] and [[Google Chrome]])
; {{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). If no value is supplied, the template uses a default of 30em. The width 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>.
; {{para|rules|yes}}
: Adds vertical lines ("rules") between the columns if set to <code>yes</code>.
; {{para|gap}}
: Specifies the space between the content of adjacent columns, in any valid CSS width 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|small|yes}}
: Sets font size to 90%.
; {{para|content}}
: Content to apply to the columns.


==Usage==
===Example of "colwidth" parameter===
; {{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).
<pre>
; {{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>
{{div col|colwidth=10em}} <!-- column width of 10em -->
; {{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>).
* a
; {{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 is 1em.
* b
; {{para|style}} : CSS styling to apply to the columns.
* c
* d
* e
* f
* g
* h
{{div col end}}
</pre>
Produces:
{{Div col|colwidth=10em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}


==Examples==
===Example of "rules" parameter===
<pre>
<pre>
{{Div col}}
{{Div col|colwidth=10em|rules=yes}} <!-- column width of 10em with rules -->
* a
* a
* b
* b
Ред 33: Ред 65:
{{Div col end}}
{{Div col end}}
</pre>
</pre>
; produces:
Produces:
{{Div col}}
{{Div col|colwidth=10em|rules=yes}}
* a
* a
* b
* b
Ред 45: Ред 77:
{{Div col end}}
{{Div col end}}


===Example of "gap" parameter===
<pre>
<pre>
{{Div col|3}}
{{Div col|colwidth=10em|rules=yes|gap=2em}} <!-- column width of 10em with rules and a gap of 2em -->
* a
* a
* b
* b
Ред 57: Ред 90:
{{Div col end}}
{{Div col end}}
</pre>
</pre>
; produces:
Produces:
{{Div col|3}}
{{Div col|colwidth=10em|rules=yes|gap=2em}}
* a
* a
* b
* b
Ред 69: Ред 102:
{{Div col end}}
{{Div col end}}


===Example of "small" parameter===
<pre>
<pre>
{{Div col||10em}}
{{Div col|small=yes}} <!-- Small = yes -->
* a
* a
* b
* b
Ред 81: Ред 115:
{{Div col end}}
{{Div col end}}
</pre>
</pre>
; produces:
Produces:
{{Div col||10em}}
{{Div col|small=yes}}
* a
* a
* b
* b
Ред 93: Ред 127:
{{Div col end}}
{{Div col end}}


===Example of "content" parameter===
<pre>
{{Div col|colwidth=10em|content= <!-- content parameter doesn't need {{div col end}} -->
* a
* b
* c
* d
* e
* f
* g
* h
}}
</pre>
Produces:
{{Div col|colwidth=10em|content=
* a
* b
* c
* d
* e
* f
* g
* h
}}
===Usage with multiple parameters===
<pre>
<pre>
{{Div col|rules=yes}}
{{Div col|colwidth=10em|rules=yes|gap=2em|small=yes}}
* a
* a
* b
* b
Ред 105: Ред 165:
{{Div col end}}
{{Div col end}}
</pre>
</pre>
; produces:
Produces:
{{Div col|rules=yes}}
{{Div col|colwidth=10em|rules=yes|gap=2em|small=yes}}
* a
* a
* b
* b
Ред 116: Ред 176:
* h
* h
{{Div col end}}
{{Div col end}}
 
=== Colwidth 20em ===
<pre>
<pre>
{{Div col|small=yes}}
{{div col|colwidth=20em}}
* a
* a
* b
* b
Ред 127: Ред 187:
* g
* g
* h
* h
{{Div col end}}
{{div col end}}
</pre>
</pre>
; produces:
Produces:
{{Div col|small=yes}}
{{Div col|colwidth=20em}}
* a
* a
* b
* b
Ред 140: Ред 200:
* h
* h
{{Div col end}}
{{Div col end}}
=== Text characters without list markup ===
<pre>
{{div col|colwidth=10em}} <!--Text characters without list markup -->
a
b
c
d
e
f
g
h
{{div col end}}
</pre>
Produces
{{Div col|colwidth=10em}}
a
b
c
d
e
f
g
h
{{Div col end}}
=== Lorem ipsum ===
<pre>
{{div col|colwidth=20em}} <!--Lorem ipsum -->
{{lorem ipsum}}
{{div col end}}
</pre>
Produces
{{Div col|colwidth=20em}}
{{lorem ipsum}}
{{Div col end}}
== Limitation ==
=== Sub-lists ===
The underlying CSS system is unable to break sub-lists into columns. Note the uneven formatting below:
<pre>
{{Div col|colwidth=10em|rules=yes|gap=2em|style=column-count:3|content=
* a
* b
* c
** c.d
** c.e
** c.f
* g
* h
}}
</pre>
Produces:
{{Div col|colwidth=10em|rules=yes|gap=2em|style=column-count:3|content=
* a
* b
* c
** c.d
** c.e
** c.f
* g
* h
}}
Turning off the {{code|break-inside: avoid-column;}} rule appears to help.<!-- A full page refersh is needed; just F12-ing doesn't work. -->
==Tracking categories==
* {{category link with count|Pages using div col with unknown parameters}} (for erroneous use of parameter names not documented here)
* {{category link with count|Pages using div col with small parameter}}


==TemplateData==
==TemplateData==
{{TemplateDataHeader}}
{{TemplateData header}}
{{#switch: {{BASEPAGENAME}}
{{#switch: {{BASEPAGENAME}}
|Div col=<templatedata>
|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 {{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": {
"colwidth": {
            "label": "cols",
"label": "Column width",
            "description": "Specifies the number of columns.",
"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",
            "default": "2",
"example": "30em"
            "aliases": ["1"],
},
            "required": false
"rules": {
        },
"label": "Rules",
        "colwidth": {
"description": "Produces vertical rules between the columns if set to yes.",
            "label": "colwidth",
"type": "string",
            "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.",
"example": "yes"
            "type": "string",
},
            "aliases": ["2"],
"gap": {
            "required": false
"label": "Gap size",
        },
"description": "Specifies the space between the content of adjacent columns.",
        "rules": {
"type": "string",
            "label": "rules",
"example": "2em"
            "description": "Produces vertical rules between the columns if set to yes.",
},
            "type": "string",
"style": {
            "required": false
"label": "CSS style",
        },
"description": "Specifies any custom styling.",
        "gap": {
"type": "string"
            "label": "gap",
},
            "description": "Specifies the space between the content of adjacent columns.",
"content": {
            "type": "string",
"label": "Content",
            "required": false
"description": "Specifies the content to divide into columns",
        },
"type": "string"
        "style": {
},
            "label": "style",
"small": {
            "description": "Specifies any custom styling.",
"label": "Small font",
            "type": "string",
"description": "Use a smaller font size (90%)",
            "required": false
"example": "yes",
        }
"type": "string"
    }
}
}
}
}
</templatedata>
</templatedata>
Ред 194: Ред 325:


==Redirects==
==Redirects==
* {{tl|Div col start}}
{{#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 begin}}
* {{Tlx|Div-col}}
* {{Tlx|Palmares start}}
}}
{{#ifeq:{{ROOTPAGENAME}}|Div col end|
*{{Tlx|Col div end}}
*{{Tlx|Colend}} (but '''not''' {{Tlx|Col end}})
*{{Tlx|Div end}}
*{{Tlx|Divcol-end}}
*{{Tlx|Divcolend}}
*{{Tlx|Divend}}
*{{Tlx|End div col}}
*{{Tlx|EndDivCol}}
}}


==See also==
==See also==
{{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:Table and 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>

Верзија на датум 8. јануар 2021. у 21:30

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)
Не Не Не ≥ 11.1
(2011)

The div col (short for division columns) formats a list into columns that wrap at multiple screen resolutions responsively. 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.

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). If no value is supplied, the template uses a default of 30em. The width 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.
|rules=yes
Adds vertical lines ("rules") between the columns if set to yes.
|gap=
Specifies the space between the content of adjacent columns, in any valid CSS width 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

{{div col|colwidth=10em}} <!-- column width of 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

{{Div col|colwidth=10em|rules=yes}} <!-- column width of 10em with rules -->
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}

Produces:

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

Example of "gap" parameter

{{Div col|colwidth=10em|rules=yes|gap=2em}} <!-- column width of 10em with rules and a gap of 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

{{Div col|small=yes}} <!-- 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

{{Div col|colwidth=10em|content= <!-- content parameter doesn't need {{div col end}} -->
* a
* b
* c
* d
* e
* f
* g
* h
}}

Produces:

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

Usage with multiple parameters

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

Produces:

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

Colwidth 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

Text characters without list markup

{{div col|colwidth=10em}} <!--Text characters without list markup -->
a
b
c
d
e
f
g
h
{{div col end}}

Produces

a b c d e f g h

Lorem ipsum

{{div col|colwidth=20em}} <!--Lorem ipsum -->
{{lorem ipsum}}
{{div col end}}

Produces

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Limitation

Sub-lists

The underlying CSS system is unable to break sub-lists into columns. Note the uneven formatting below:

{{Div col|colwidth=10em|rules=yes|gap=2em|style=column-count:3|content=
* a
* b
* c
** c.d
** c.e
** c.f
* g
* h
}}

Produces:

  • a
  • b
  • c
    • c.d
    • c.e
    • c.f
  • g
  • h

Turning off the break-inside: avoid-column; rule appears to help.

Tracking categories

TemplateData

Ово је TemplateData документација за овај шаблон, коришћена у Визуелном уређивачу и у другим алаткама; погледајте месечни извештај о грешкама за овај шаблон.

TemplateData за 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}}.

Параметри шаблона

ПараметарОписВрстаСтатус
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.

Пример
30em
текстнеобавезно
Rulesrules

Produces vertical rules between the columns if set to yes.

Пример
yes
текстнеобавезно
Gap sizegap

Specifies the space between the content of adjacent columns.

Пример
2em
текстнеобавезно
CSS stylestyle

Specifies any custom styling.

текстнеобавезно
Contentcontent

Specifies the content to divide into columns

текстнеобавезно
Small fontsmall

Use a smaller font size (90%)

Пример
yes
текстнеобавезно

Redirects


See also

Column-generating template families

Family Type
Handles wiki
 table code?dagger
Start template Column divider End template
"Col" Table Да {{Col-begin}}
or {{Col-begin-small}}
{{Col-break}}
{{Col-2}} .. {{Col-5}}
{{Col-end}}
"Columns" Table Не {{Columns}}
"Multicol" Table Да {{Multicol}} {{Multicol-break}} {{Multicol-end}}
"Col-float" CSS float Да {{Col-float}} {{Col-float-break}} {{Col-float-end}}
"Columns-start" CSS float Да {{Columns-start}} {{Column}} {{Columns-end}}
"Div col" CSS columns Да {{Div col}}
– {{Columns-list}} (wrapper)
{{No col break}} {{Div col end}}

dagger 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.