Columns – Template

From Bohemia Interactive Community
Revision as of 20:03, 12 April 2025 by Lou Montana (talk | contribs) (Add noresize wrapping)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Creates CSS columns. It also adds the page to the Columns template usage error category on usage error.

This template is used on these pages.

Usage

{{Columns|colsInfo|content|expand}}

  • colsInfo: columns CSS attribute's definition - see columns, can be:
    • desired columns number, e.g 4
    • column width, e.g 12em
    • a mix of the two, e.g 4 12em - in this case, columns number is the maximum columns number
  • content: to be split in columns, usually a list
  • expand: named parameter. makes the columns take the whole width
Examples
Code Result
{{Columns}}
-no columns information defined-
{{Columns|3}}
-no columns content defined-
{{Columns||
* contentA
* contentB
* contentC
* contentD
}}
-no columns information defined-
{{Columns|2|
* contentA
* contentB
* contentC
* contentD
}}
  • contentA
  • contentB
  • contentC
  • contentD
{{Columns|3|
* contentA
* contentB
* contentC
* contentD
}}
  • contentA
  • contentB
  • contentC
  • contentD
{{Columns|4|
* contentA
* contentB
* contentC
* contentD
}}
  • contentA
  • contentB
  • contentC
  • contentD
<div style="border: 1px solid red; width: 50em">
Above
{{Columns|3|
* contentA
* contentB
* contentC
* contentD
|expand= y
}}
Below
</div>

Above

  • contentA
  • contentB
  • contentC
  • contentD

Below

<div style="border: 1px solid red; width: 50em">
{{Columns|3 10em|
* contentA, which can totally do with a lipsum amongst other things, yes
* contentB, which can totally do with a lipsum amongst other things, too
* contentC, which can totally do with a lipsum amongst other things, too
* contentD, which can totally do with a lipsum amongst other things, too
* contentE, which can totally do with a lipsum amongst other things, too
* contentF, which can totally do with a lipsum amongst other things, too
* contentG, which can totally do with a lipsum amongst other things, too
* contentH, which can totally do with a lipsum amongst other things, too
* contentI, which can totally do with a lipsum amongst other things, too
* contentJ, which can totally do with a lipsum amongst other things, too
}}
</div>
  • contentA, which can totally do with a lipsum amongst other things, yes
  • contentB, which can totally do with a lipsum amongst other things, too
  • contentC, which can totally do with a lipsum amongst other things, too
  • contentD, which can totally do with a lipsum amongst other things, too
  • contentE, which can totally do with a lipsum amongst other things, too
  • contentF, which can totally do with a lipsum amongst other things, too
  • contentG, which can totally do with a lipsum amongst other things, too
  • contentH, which can totally do with a lipsum amongst other things, too
  • contentI, which can totally do with a lipsum amongst other things, too
  • contentJ, which can totally do with a lipsum amongst other things, too