Difference between revisions of "Template:Col-float"
imported>Great Brightstar (Move the default width into TemplateStyle) |
imported>TheDJ m (move more into template styles) |
||
| Line 1: | Line 1: | ||
| − | <includeonly><templatestyles src="Col-float/styles.css"/><div class="multicol-float {{{class|}}}" style=" | + | <includeonly><templatestyles src="Col-float/styles.css" /><div class="multicol-float {{{class|}}}" style="{{#if:{{{nextcol|{{{firstcol|{{{width|}}}}}}}}}|min-width: {{{nextcol|{{{firstcol|{{{width|}}}}}}}}};}}{{{style|}}}">{{{{{|safesubst:}}}#if:{{{1|}}}|{{{{{|safesubst:}}}#invoke:separated entries|main|separator= |
| − | </div><div | + | </div><div class="multicol-float {{{class|}}}" style="min-width: {{{nextcol|{{{width|30.0em}}}}}};{{{style|}}}">}} |
| − | </div><div | + | </div><div class="multicol-float-clear {{{class|}}}" style="{{{style|}}}" ></div>}}</includeonly><noinclude>{{Documentation}}</noinclude> |
Latest revision as of 13:09, 14 May 2020
| This template uses Lua: |
Script error: No such module "Uses TemplateStyles".
Side-by-side columns, based on CSS float.
This has the advantage of more cross-device-accessible behaviour, as (unlike HTML <table>s) they will wrap on display windows too narrow to show them side-by-side.
| Column templates |
|---|
| Accessibility |
| Basic |
|
| Float |
|
| Div col |
|
Contents
Parameters
All optional and applicable to {{Col-float}} / {{Start col-float}} and {{Col-float-break}} / {{Break col-float}} except firstcol:
- firstcol (with Col-float or Start col-float only)
- nextcol
width- Width of the next – or, with Col-float/Start col-float, the first – column. IE-based browsers require a specified width, so defaults to 30.0em.
- class
- For any styling defined using classes.
- style
- For any additional styling.
{{Col-float}} can be used with numbered parameters for columns (i.e. |1= is the first column, |2= is the second, and so on). However, lists have to be preceded with <nowiki/> and a newline, and tables have to use {{!}}.
Example section (from Hydrolastic)
With {{Col-float-break}}
Cars using the Hydrolastic suspension system:
- BMC 1100
- Mini (from 1964 to 1971)
- Austin America (from 1968 to 1971)
- Austin 1800
- Austin Maxi (until March 1978)
- Austin 3-Litre
- MG 1100 (from 1962 to 1968)
Cars using the Hydragas suspension system:
- Austin Ambassador
- Princess
- Austin Allegro
- Austin Maxi (from March 1978 onwards)
- Austin Metro
- Rover Metro
- Rover 100
{{col-float}}
'''Cars using the [[Hydrolastic]] suspension system:'''
* [[BMC ADO16|BMC 1100]]
* [[Mini]] (from 1964 to 1971)
* [[Austin America]] (from 1968 to 1971)
* [[Austin 1800]]
* [[Austin Maxi]] (until March 1978)
* [[Austin 3-Litre]]
* [[MG 1100]] (from 1962 to 1968)
{{col-float-break}}
'''Cars using the [[Hydragas]] suspension system:'''
* [[Austin Ambassador]]
* [[Leyland Princess|Princess]]
* [[Austin Allegro]]
* [[Austin Maxi]] (from March 1978 onwards)
* [[Austin Metro]]
* [[Rover Metro]]
* [[Rover P4#P4 100|Rover 100]]
{{col-float-end}}
With numbered parameters
- BMC 1100
- Mini (from 1964 to 1971)
- Austin America (from 1968 to 1971)
- Austin 1800
- Austin Maxi (until March 1978)
- Austin 3-Litre
- MG 1100 (from 1962 to 1968)
{{col-float
|1=
'''Cars using the [[Hydrolastic]] suspension system:'''
* [[BMC ADO16|BMC 1100]]
* [[Mini]] (from 1964 to 1971)
* [[Austin America]] (from 1968 to 1971)
* [[Austin 1800]]
* [[Austin Maxi]] (until March 1978)
* [[Austin 3-Litre]]
* [[MG 1100]] (from 1962 to 1968)
|2=
'''Cars using the [[Hydragas]] suspension system:'''
* [[Austin Ambassador]]
* [[Leyland Princess|Princess]]
* [[Austin Allegro]]
* [[Austin Maxi]] (from March 1978 onwards)
* [[Austin Metro]]
* [[Rover Metro]]
* [[Rover P4#P4 100|Rover 100]]
}}
See also
Column-generating template families
| The templates listed here are not interchangeable. For example, using {{col-float}} with {{col-end}} instead of {{col-float-end}} would leave a HTML "div" (division) open, potentially harming any subsequent formatting. |
<section begin="table" />
| Family | Type | Handles wiki
table code? |
Responsive/ Mobile suited |
Start template | Column divider | End template |
|---|---|---|---|---|---|---|
| "Col" | Table | Yes | Yes | {{Col-begin}}, {{Col-begin-fixed}} or {{Col-begin-small}} |
{{Col-break}} or {{Col-2}} .. {{Col-5}} |
{{Col-end}} |
| "Col-float" | CSS float | Yes | Yes | {{Col-float}} | {{Col-float-break}} | {{Col-float-end}} |
| "Columns" | Table | No | Yes | {{Columns}} | – | – |
| "Columns-list" | CSS columns | Yes | Yes | {{Columns-list}} (wrapper) | – | – |
| "Columns-start" | CSS float | Yes | Yes | {{Columns-start}} | {{Column}} | {{Columns-end}} |
| "Flex columns" | CSS flexbox | Yes | Yes | {{Flex columns}} | – | – |
| "Div col" | CSS columns | Yes | Yes | {{Div col}} | – | {{Div col end}} |
I.e., can the columns handle the wiki markup {| | || |- |} used to create tables? If not, templates that produce these elements (such as {{(!}}, {{!}}, {{!!}}, {{!-}}, {{!)}}) or HTML tags (<table>...</table>, <tr>...</tr>, etc.) will need to be used instead.<section end="table" />
| The above documentation is transcluded from Template:Col-float/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |