Difference between revisions of "Help:Columns"

(Creation (as this is needed))
 
m (removing "Template:Short description" as it is not working as needed)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Shortcuts|H:COL}}
 
{{Shortcuts|H:COL}}
{{Short description|How to create columns in an article}}
+
 
 
== colbegin and colend ==
 
== colbegin and colend ==
 
To create columns in an article one may use {{tl|colbegin}} and {{tl|colend}}. Note that this is not supported by Internet Explorer version 9 and below or Opera version 11 and below — see {{tl|Div col}} for details. This example uses {{tl|lorem}} to generate placeholder text.
 
To create columns in an article one may use {{tl|colbegin}} and {{tl|colend}}. Note that this is not supported by Internet Explorer version 9 and below or Opera version 11 and below — see {{tl|Div col}} for details. This example uses {{tl|lorem}} to generate placeholder text.
Line 58: Line 58:
  
 
== CSS3 multicolumn support ==
 
== CSS3 multicolumn support ==
{{Further|Template:Reflist#Browser support for columns}}
 
 
{{CSS3 multiple column layout}}
 
{{CSS3 multiple column layout}}
The templates {{tl|div col}} and {{tl|divbegin}} use a feature in [[CSS3]] that is implemented in:
+
The templates {{tl|div col}} and {{tl|divbegin}} use a feature in [[w:CSS3|CSS3]] that is implemented in:
* [[Gecko (software)|Gecko]]-based browsers, such as [[Firefox]] 1.5
+
* [[w:Gecko (software)|Gecko]]-based browsers, such as Firefox
* [[Presto (browser engine)|Presto]]-based browsers, such as [[Opera (web browser)|Opera]] 11.1
+
* [[w:Presto (browser engine)|Presto]]-based browsers, such as Opera 11.1
* [[WebKit]]-based browsers, such as [[Safari (web browser)]] 3 and [[Google Chrome]] 1
+
* [[w:WebKit|WebKit]]-based browsers, such as Safari 3 and Google Chrome
* [[MSHTML]]-based browsers, such as [[Internet Explorer]] 10
+
* [[w:MSHTML|MSHTML]]-based browsers, such as Internet Explorer
  
 
== See also ==
 
== See also ==
 
* [[Help:Tables]]
 
* [[Help:Tables]]
* [[m:wiki markup tables]]
+
* [[mw:wiki markup tables|MediaWiki: Wiki markup tables]]
 
* [[Template:Columns-list]]
 
* [[Template:Columns-list]]
  
 
[[Category:Help|Columns]]
 
[[Category:Help|Columns]]

Latest revision as of 16:57, 30 August 2023

colbegin and colend[edit]

To create columns in an article one may use {{colbegin}} and {{colend}}. Note that this is not supported by Internet Explorer version 9 and below or Opera version 11 and below — see {{Div col}} for details. This example uses {{lorem}} to generate placeholder text.

{{colbegin}}
{{lorem}}
{{lorem}}
{{colend}}

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.

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.


You can also use {{col-begin}}, {{col-break}}, and {{col-end}}. But don't use this variety to set numbered or bulleted lists in columns, because {{col-break}} breaks the list up, which is a problem for accessibility.

As such:

{{col-begin}}
{{col-break}}
{{lorem}}
{{col-break}}
{{lorem}}
{{col-break}}
{{lorem}}
{{col-end}}

creates

CSS[edit]

MediaWiki:Common.css defines the following styles:

  • "div.columns-2", "div.columns-3", "div.columns-4" and "div.columns-5" which need to contain a "div.column"

Templates[edit]

CSS3 multicolumn support[edit]

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)

The templates {{div col}} and {{divbegin}} use a feature in CSS3 that is implemented in:

  • Gecko-based browsers, such as Firefox
  • Presto-based browsers, such as Opera 11.1
  • WebKit-based browsers, such as Safari 3 and Google Chrome
  • MSHTML-based browsers, such as Internet Explorer

See also[edit]