Difference between revisions of "Template:Progress bar"
Jump to navigation
Jump to search
(trying a template) |
(add some options) |
||
Line 1: | Line 1: | ||
<includeonly><span> | <includeonly><span> | ||
<div style="border:1px solid #000;"> | <div style="border:1px solid #000;"> | ||
− | <div style="background:#0f0; text-align:right; padding:0em; width:{{formatnum:{{#if:{{#if:{{{1|}}}|{{{1}}}|0}}|{{#expr:100*{{#if:{{{1|}}}|{{{1}}}|0}}/{{{2|{{{total|100}}}}}}round {{{decimal|1}}}}}}}}}%"> | + | <div style="background:{{{color|#0f0}}}; text-align:right; padding:0em; width:{{formatnum:{{#if:{{#if:{{{1|}}}|{{{1}}}|0}}|{{#expr:100*{{#if:{{{1|}}}|{{{1}}}|0}}/{{{2|{{{total|100}}}}}}round {{{decimal|1}}}}}}}}}%"> |
− | {{{1}}}/{{{2}}} | + | {{{1}}}/{{{2}}}{{#if:{{{3|}}}| {{{3}}}}} |
</div> | </div> | ||
</div></includeonly><noinclude> | </div></includeonly><noinclude> | ||
− | + | Template for displaying a progress bar, for use on a gamestate page. | |
+ | |||
+ | ==Usage== | ||
+ | |||
+ | ===Regular=== | ||
+ | <code><nowiki>{{progress bar|3|7}}</nowiki></code> produces: | ||
{{progress bar|3|7}} | {{progress bar|3|7}} | ||
+ | |||
+ | ===Specify units=== | ||
+ | <code><nowiki>{{progress bar|3|7|players}}</nowiki></code> produces: | ||
+ | |||
+ | {{progress bar|3|7|players}} | ||
+ | |||
+ | ===Colour=== | ||
+ | <code><nowiki>{{progress bar|3|7|color=#f90}}</nowiki></code> produces: | ||
+ | |||
+ | {{progress bar|3|7|color=#f90}} | ||
</noinclude> | </noinclude> |
Revision as of 14:53, 21 July 2023
Template for displaying a progress bar, for use on a gamestate page.
Contents
Usage
Regular
{{progress bar|3|7}}
produces:
3/7
Specify units
{{progress bar|3|7|players}}
produces:
3/7 players
Colour
{{progress bar|3|7|color=#f90}}
produces:
3/7