Difference between revisions of "Grid"
From Gulf of Fallen Stars
(16 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
=== Parameters === | === Parameters === | ||
− | '''type(required):''' begin / div / end | + | '''type(required):''' begin / div / end ("nl" can be used instead of div, if you want a newline in the grid) |
− | '''cols(default 3):''' number of columns on widest screen | + | '''cols(default 3):''' number of columns on widest screen. If set to 0, width/number columns is not defined. |
+ | |||
+ | '''ignoreminwidth(default false):''' columns will have no minimum width | ||
'''border(default false):''' whether the box should have a border | '''border(default false):''' whether the box should have a border | ||
Line 10: | Line 12: | ||
'''center(default false):''' center the text in the div | '''center(default false):''' center the text in the div | ||
+ | |||
+ | '''nomargin(default false):''' Overrides all margins and padding to 0 | ||
</noinclude><includeonly><!-- | </noinclude><includeonly><!-- | ||
-->{{#vardefine:cols|{{{cols|3}}}}}<!-- | -->{{#vardefine:cols|{{{cols|3}}}}}<!-- | ||
− | -->{{#ifeq: {{#var:cols}}|1|{{#vardefine:width| | + | -->{{#ifeq: {{#var:cols}}|0|{{#vardefine:width|auto}}{{#vardefine:minwidth|0}}}}<!-- |
− | -->{{#ifeq: {{#var:cols}}|2|{{#vardefine:width|49%}}{{#vardefine:minwidth| | + | -->{{#ifeq: {{#var:cols}}|1|{{#vardefine:width|100%}}{{#vardefine:minwidth|100%}}}}<!-- |
− | -->{{#ifeq: {{#var:cols}}|3|{{#vardefine:width|32%}}{{#vardefine:minwidth| | + | -->{{#ifeq: {{#var:cols}}|2|{{#vardefine:width|49%}}{{#vardefine:minwidth|500px}}}}<!-- |
− | -->{{#ifeq: {{#var:cols}}|4|{{#vardefine:width| | + | -->{{#ifeq: {{#var:cols}}|3|{{#vardefine:width|32%}}{{#vardefine:minwidth|330px}}}}<!-- |
+ | -->{{#ifeq: {{#var:cols}}|4|{{#vardefine:width|24%}}{{#vardefine:minwidth|250px}}}}<!-- | ||
+ | -->{{#ifeq: {{#var:cols}}|5|{{#vardefine:width|19%}}{{#vardefine:minwidth|200px}}}}<!-- | ||
+ | -->{{#ifeq: {{#var:cols}}|6|{{#vardefine:width|16%}}{{#vardefine:minwidth|160px}}}}<!-- | ||
+ | |||
+ | -->{{#if:{{{ignoreminwidth|}}}|{{#vardefine:minwidth|0}}}}<!-- | ||
-->{{#if:{{{border|}}}<!-- | -->{{#if:{{{border|}}}<!-- | ||
− | -->|{{#vardefine:boxstyle|border:1px solid #DDDDDD | + | -->|{{#vardefine:boxstyle|border:1px solid #DDDDDD;}}{{#vardefine:background|background-color:#ffffff;}}{{#vardefine:margin|margin:4px;}}<!-- |
− | -->|{{#vardefine:boxstyle|}}{{#vardefine:background|# | + | -->|{{#vardefine:boxstyle|}}{{#vardefine:background|background-color:#FFFFFF00;}}<!-- |
-->}}<!-- | -->}}<!-- | ||
− | -->{{#if:{{{background|}}}|{{#vardefine:background|{{{background|}}}}}}}<!-- | + | -->{{#if:{{{background|}}}|{{#vardefine:background|background-color:{{{background|}}};}}}}<!-- |
+ | |||
+ | -->{{#if:{{{center|}}}|{{#vardefine:textstyle|text-align:center;}}{{#vardefine:padding|padding:20px;}}|{{#vardefine:padding|padding:10px;}}}}<!-- | ||
+ | |||
+ | -->{{#if:{{{nomargin|}}}|{{#vardefine:margin|margin:0px;}}{{#vardefine:padding|padding:0px;}}|}}<!-- | ||
− | -->{{# | + | -->{{#vardefine:startdivs|<div style="display:inline-table;width:{{#var:width}};min-width:{{#var:minwidth}};"><div style="{{#var:boxstyle}}{{#var:margin}}{{#var:padding}}{{#var:background}}{{#var:textstyle|}}">}}<!-- |
+ | -->{{#vardefine:enddivs|</div></div>}}<!-- | ||
− | -->{{#ifeq:{{{type}}}|begin| | + | -->{{#ifeq:{{{type}}}|begin|{{#var:startdivs}}}}<!-- |
− | -->{{#ifeq:{{{type}}}| | + | -->{{#ifeq:{{{type}}}|div|{{#var:enddivs}}{{#var:startdivs}}|}}<!-- |
− | -->{{#ifeq:{{{type}}}|end| | + | -->{{#ifeq:{{{type}}}|nl|{{#var:enddivs}} |
+ | <wbr> | ||
+ | {{#var:startdivs}}|}}<!-- | ||
+ | -->{{#ifeq:{{{type}}}|end|{{#var:enddivs}}}} |
Latest revision as of 21:56, 10 March 2020
Parameters
type(required): begin / div / end ("nl" can be used instead of div, if you want a newline in the grid)
cols(default 3): number of columns on widest screen. If set to 0, width/number columns is not defined.
ignoreminwidth(default false): columns will have no minimum width
border(default false): whether the box should have a border
background(default transparent): the background of the grid cell. Defaults to white if border is true.
center(default false): center the text in the div
nomargin(default false): Overrides all margins and padding to 0