Template:Div col: Difference between revisions

From STRIDE Wiki
Jump to navigation Jump to search
m (1 revision)
 
(No difference)

Latest revision as of 22:29, 7 July 2015

{{#ifeq:div col |doc

    | 

{{#ifeq:show |show

|
        }}{{#if: |
         |   {{#ifexist:Template:Div col
                  | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
                  |
                 }}
        }}
    | 
   }}
CSS3 multiple-column layout
browser support
Internet
Explorer
Firefox Safari Chrome Opera
≤ 9 ≤ 1.0 ≤ 2 {{#if:|Template:Hs}}N/A ≤ 11.0
≥ 10
{{#if:(2012)
(2012) 90%

}} || style="background:#9F9;vertical-align:middle;text-align:center;" class="table-yes"|≥ 1.5
{{#if:(2005)

(2005) 90%

}} || style="background:#9F9;vertical-align:middle;text-align:center;" class="table-yes"|≥ 3
{{#if:(2007)

(2007) 90%

}} || style="background:#9F9;vertical-align:middle;text-align:center;" class="table-yes"|≥ 1
{{#if:(2008)

(2008) 90%

}} || style="background:#9F9;vertical-align:middle;text-align:center;" class="table-yes"|≥ 11.1
{{#if:(2011)

(2011) 90%

}}

{{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 options to set a smaller (90%) font-size (|{{#if:small|small=}}yes), place vertical lines ("rules") between the columns (|{{#if:rules|rules=}}) and to add other custom styling (|{{#if:style|style=}}).

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

Usage

|{{#if:cols|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).
|{{#if:colwidth|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.
|{{#if:rules|rules=}}
Adds vertical lines ("rules") between the columns if set to yes or some CSS styling (e.g. 1px dashed blue;).
|{{#if:gap|gap=}}
Specifies the space between the content of adjacent columns. The default spacing is 1em.
|{{#if:style|style=}}
CSS styling to apply to the columns.

Examples

{{Div col}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
{{#if: |{{{content}}}
}}{{#ifeq: |yes
   |}}
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col|3}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
{{#if: |{{{content}}}

}}{{#ifeq: |yes

   |}}
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col||10em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
{{#if: |{{{content}}}

}}{{#ifeq: |yes

   |}}
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col|rules=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
{{#if: |{{{content}}}

}}{{#ifeq: |yes

   |}}
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col|small=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
{{#if: |{{{content}}}

}}{{#ifeq: yes|yes

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

TemplateData

{{#if:| |This is the TemplateData documentation for this template used by VisualEditor and other tools.}}

Div col

{{#ifeq:Div col|sandbox||

}} {{#switch: Div col |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> |Div col end=<templatedata> {

"description": "Ends a multi-column list started by

{{#if: |{{{content}}}

}}{{#ifeq: |yes

   |}}. It takes no parameters.",
   "params": {
   }

} </templatedata> }}

Redirects

See also

Column-generating template families

Family Type <div style="padding:0.1em 0;line-height:1.2em;{{#if:Handles wiki
 table code?File:Dagger-14-plain.png|font-weight:normal}}">{{#if:Handles wiki
 table code?File:Dagger-14-plain.png|Handles wiki
 table code?File:Dagger-14-plain.png|font-weight:normal}}
Start template Break between columns End template
"Col" Table {{Col-begin}}
or {{Col-begin-small}}
{{Col-break}}
{{Col-2}} .. {{Col-5}}
{{Col-end}}
"Col-float" CSS float File:Green check.svgY {{Col-float}} {{Col-float-break}} {{Col-float-end}}
"Columns" Table File:Green check.svgY {{Columns}}
"Columns-start" CSS float File:Green check.svgY {{Columns-start}} {{Column}} {{Columns-end}}
"Div col" CSS columns File:Green check.svgY {{Div col}}
– {{Columns-list}} (wrapper)
{{Div col end}}
"Multicol" Table {{Multicol}} {{Multicol-break}} {{Multicol-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 ({{#switch:pair

 |c|close =
 |s|single
 |o|open
 |p|pair = <table{{#if:| {{{params}}}}}
}}{{#switch:pair
 |c|close = 
 |s|single =  />
 |o|open = >
 |p|pair = {{#ifeq:table|!--||>}}...
}}{{#switch:pair
 |s|single
 |o|open =
 |c|close
 |p|pair = {{#ifeq:table|!--|-->|</table>}}
}}, {{#switch:pair
 |c|close =
 |s|single
 |o|open
 |p|pair = <tr{{#if:| {{{params}}}}}
}}{{#switch:pair
 |c|close = 
 |s|single =  />
 |o|open = >
 |p|pair = {{#ifeq:tr|!--||>}}...
}}{{#switch:pair
 |s|single
 |o|open =
 |c|close
 |p|pair = {{#ifeq:tr|!--|-->|</tr>}}
}}, etc.) will need to be used instead.


{{#ifeq:Div col|sandbox | |

{{#switch:Div col |Div col= |Div col end=}} es:Plantilla:Div col }}