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

From blackwiki
Jump to navigation Jump to search
imported>Waldyrious
(→‎Usage: update/clarify)
imported>Edokter
(correct documentation)
Line 4: Line 4:
  
 
This template can create multiple columns in [[web browser]]s which support one of the following [[CSS]] properties:
 
This template can create multiple columns in [[web browser]]s which support one of 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])
 
* ''-moz-column-count'' (for [[Mozilla application framework|Mozilla]]/[[Gecko (layout engine)|Gecko]] based browsers such as [[Firefox]])
 
* ''-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]])
 
* ''-webkit-column-count'' (for [[WebKit]] based browsers such as [[Safari (web browser)|Safari]] and [[Google Chrome]])
* ''column-count'' (for [[Cascading Style Sheets#CSS 3|CSS3]] compliant browsers; see [http://www.w3.org/TR/css3-multicol/ CSS3 module: Multi-column layout])
 
  
 
Therefore, the template does not work in browsers such as [[Internet Explorer]] and [[Opera (web browser)|Opera]] (see [[Template:Reflist#Browser support for columns]]).
 
Therefore, the template does not work in browsers such as [[Internet Explorer]] and [[Opera (web browser)|Opera]] (see [[Template:Reflist#Browser support for columns]]).
Line 12: Line 12:
 
=== Usage ===
 
=== Usage ===
  
; cols    =: Specifies the number of columns.  Defaults to 2.  If the <tt>colwidth</tt> parameter is also specified, this acts as the maximum number of columns.
+
; cols    =: Specifies the number of columns.  Defaults to 2 columns.
; colwidth =: Specifies the width of columns, and determines dynamically the number of columns based on width. Setting this parameter will result in more columns being shown on wider displays.  
+
; colwidth =: 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 <tt>cols=</tt> setting.
 
; small    =: Specifies small font size (90%) if set to <tt>yes</tt>.
 
; small    =: Specifies small font size (90%) if set to <tt>yes</tt>.
  

Revision as of 12:20, 1 January 2011

This template is used to make a list into columns, with the option of specifying a smaller font. It has the advantage over other column templates (i.e. {{col-begin}}) that it automatically breaks each column to an equal space, so you do not manually have to find the "half way" point on two columns, for instance.

This template can create multiple columns in web browsers which support one of the following CSS properties:

Therefore, the template does not work in browsers such as Internet Explorer and Opera (see Template:Reflist#Browser support for columns).

Usage

cols =
Specifies the number of columns. Defaults to 2 columns.
colwidth =
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.
small =
Specifies small font size (90%) if set to yes.

Examples

{{Div col}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
Produces
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col|cols=3}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
Produces
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col|colwidth=10em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
Produces
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col|small=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
Produces
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

See also