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

From blackwiki
Jump to navigation Jump to search
imported>Funandtrvl
(clarify)
imported>Edokter
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 +
{{ombox | type=notice | text = Columns are currently supported only by newer versions of [[Gecko (layout engine)|Gecko]]-based browsers (such as [[Mozilla Firefox]]) and [[WebKit]]-based browsers (such as [[Google Chrome]] and [[Safari (web browser)|Safari]]).  '''All versions of [[Internet Explorer]] through to version 9 and [[Opera (web browser)|Opera]] through to version 11 do not support columns.'''  See [[Template:Reflist#Browser support for columns|here]] for more information.}}
 +
{{CSS3 multiple column layout}}
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE. -->
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE. -->
 +
 
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. {{tl|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 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. {{tl|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.
  
Line 7: Line 10:
 
* ''-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]])
 
Multiple columns are generated by using [[Cascading Style Sheets|CSS3]]; thus, only browsers that properly support the multi-column property will show multiple columns. [[Internet Explorer 9]] does not work with this template, as of November 2011.
 
 
{{CSS3 multiple column layout}}
 
  
 
=== Usage ===
 
=== Usage ===
 
 
; cols    =: Specifies the number of columns.  Defaults to 2 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 screen  width; more columns will be shown on wider displays. This overrides the <tt>cols=</tt> setting.
 
; 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.

Revision as of 20:25, 16 November 2011

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)

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:

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.
style =
Specify any custom styling.

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