Difference between revisions of "Template:Gridcell"

From BlogNomic Wiki
Jump to navigation Jump to search
(this could use a max-width)
 
Line 1: Line 1:
style="min-width:4em; height:4em; {{#if:{{{2|}}}|background-image: linear-gradient(135deg, {{{1}}}, {{{2}}});|background-color:{{{1}}};}}"<noinclude>
+
style="min-width:4em; max-width:10em; height:4em; {{#if:{{{2|}}}|background-image: linear-gradient(135deg, {{{1}}}, {{{2}}});|background-color:{{{1}}};}}"<noinclude>
 
==Usage==
 
==Usage==
 
This template generates CSS for table cell backgrounds, for use in wiki markup tables, so that each cell appears a minimum of 4em high and wide.
 
This template generates CSS for table cell backgrounds, for use in wiki markup tables, so that each cell appears a minimum of 4em high and wide.

Latest revision as of 11:29, 15 February 2025

style="min-width:4em; max-width:10em; height:4em; background-color:{{{1}}};"

Usage

This template generates CSS for table cell backgrounds, for use in wiki markup tables, so that each cell appears a minimum of 4em high and wide.

It takes one or two colour inputs, which can be hex including the hash (eg. #69B3E7) or a web colour term (eg. aquamarine).

If only one colour is specified, the box background is that colour. If two are specified, the background shades a gradient from one to the other, top left to bottom right.

Example:

{| class="wikitable" style="text-align:center"
! !! A !! B !! C
|-
! 1
| {{gridcell}}            | 
| {{gridcell|white|grey}} | {{chip|$|gold}}
| {{gridcell|yellow}}     | 
|-
! 2
| {{gridcell|#aaffaa}}    | {{box|Refuel Point}}
| {{gridcell}}            |
| {{gridcell|#000}}       | {{box|Void}}
|}

produces:

A B C
1
$
2
Refuel Point
Void

Related templates