• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Col-flex

  • Template
  • Talk
  • Language
  • Watch
  • Edit
Template documentation[view] [edit] [history] [purge]
This template uses Lua:
  • Module:Separated entries (sandbox)
CSSThis template uses TemplateStyles:
  • Template:Col-flex/styles.css

Side-by-side columns, based on CSS flexbox.

One of the most defining features of the flex layout is its ability to form-fit, based on its viewing environment. Flex boxes can adjust in size—either decreasing, to avoid unnecessarily monopolizing space, or increasing to make room for contents to fit within its boundaries. Moreover, the flex layout is less restrictive in terms of content flow than that of other CSS layout models, which are generally uni-directional.

Contents

  • 1 Use
  • 2 Example
  • 3 See also
    • 3.1 Column-generating template families

Use

edit

The below examples are using the templates directly:

{{col-flex}}
Column 1
*a
*b
*c
*d
{{col-flex-break}}
Column 2
*e
*f
*g
*h
{{col-flex-end}}

Produces

Column 1

  • a
  • b
  • c
  • d

Column 2

  • e
  • f
  • g
  • h
{{col-flex}}
{| class="wikitable"
|+Table1

|-
| a || b || c
|-
| d || e || f
|-
| g || h || i
|}
{{col-flex-break}}
{| class="wikitable"
|+Table2
|-
| 1 || 2 || 3
|-
| 4 || 5 || 6
|-
| 7 || 8 || 9
|}
{{col-flex-end}}

Produces:

Table1
a b c
d e f
g h i
Table2
1 2 3
4 5 6
7 8 9

Example

edit
  *   Host nation (France)
2024 Summer Olympics medal table
RankNationGoldSilverBronzeTotal
1 United States‡404442126
2 China40272491
3 Japan20121345
4 Australia18191653
5 France*16262264
6 Netherlands1571234
7 Great Britain14222965
Totals (7 entries)163157158478
  *   Host nation (Japan)
2020 Summer Olympics medal table
RankNationGoldSilverBronzeTotal
1 United States394133113
2 China38321989
3 Japan*27141758
4 Great Britain22202264
5 ROC20282371
6 Australia1772246
7 Netherlands10121436
Totals (7 entries)173154150477
{{col-flex}}

{{Medals table
| caption        = 2024 Summer Olympics medal table
| host           = [[France]]
| flag_template  = flag IOC
| event          = 2024 Summer
| gold_USA = 40 | silver_USA = 44 | bronze_USA = 42 | note_USA = {{double dagger}}
| gold_CHN = 40 | silver_CHN = 27 | bronze_CHN = 24
| gold_JPN = 20 | silver_JPN = 12 | bronze_JPN = 13
| gold_AUS = 18 | silver_AUS = 19 | bronze_AUS = 16
| gold_FRA = 16 | silver_FRA = 26 | bronze_FRA = 22 | host_FRA = yes
| gold_NED = 15 | silver_NED = 7  | bronze_NED = 12
| gold_GBR = 14 | silver_GBR = 22 | bronze_GBR = 29
}}

{{col-flex-break}}

{{Medals table
 | caption        = 2020 Summer Olympics medal table
 | host           = [[Japan]]
 | flag_template  = flag IOC
 | event          = 2020 Summer
 | gold_USA = 39 | silver_USA = 41 | bronze_USA = 33 |
 | gold_CHN = 38 | silver_CHN = 32 | bronze_CHN = 19 |
 | gold_JPN = 27 | silver_JPN = 14 | bronze_JPN = 17 | host_JPN = Yes
 | gold_GBR = 22 | silver_GBR = 20 | bronze_GBR = 22 |
 | gold_ROC = 20 | silver_ROC = 28 | bronze_ROC= 23 | 
 | gold_AUS = 17 | silver_AUS = 7 | bronze_AUS = 22 |
 | gold_NED = 10 | silver_NED = 12 | bronze_NED = 14 |
}}

{{col-flex-end}}

See also

edit

Column-generating template families

edit

The templates listed here are not interchangeable. For example, using {{col-float}} with {{col-end}} instead of {{col-float-end}} would leave a <div>...</div> open, potentially harming any subsequent formatting.

Column templates
Type Family
Handles wiki
table code?†
Responsive/
mobile suited
Start template Column divider End template
Float "col-float" Yes Yes {{col-float}} {{col-float-break}} {{col-float-end}}
"columns-start" Yes Yes {{columns-start}} {{column}} {{columns-end}}
Columns "div col" Yes Yes {{div col}} – {{div col end}}
"columns-list" No Yes {{columns-list}} (wraps div col) – –
Flexbox "flex columns" No Yes {{flex columns}} – –
Table "col" Yes No {{col-begin}},
{{col-begin-fixed}} or
{{col-begin-small}}
{{col-break}} or
{{col-2}} .. {{col-5}}
{{col-end}}

† Can the template handle the basic wiki markup {| | || |- |} used to create tables? If not, special templates that produce these elements (such as {{(!}}, {{!}}, {{!!}}, {{!-}}, {{!)}}) or HTML tags (<table>...</table>, <tr>...</tr>, etc.) need to be used instead.

The above documentation is transcluded from Template:Col-flex/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Col-flex&oldid=1300850526"
Last edited on 16 July 2025, at 18:41

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 16 July 2025, at 18:41 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop