Difference between revisions of "Template:Progress bar"

From GATE
Line 1: Line 1:
<div style="
+
<includeonly><div style="
 
   width:{{{width|75%}}};
 
   width:{{{width|75%}}};
 
{{#ifeq: {{{center|yes}}} | yes |
 
{{#ifeq: {{{center|yes}}} | yes |
Line 7: Line 7:
 
| <p>
 
| <p>
 
   '''{{#expr: ( {{{1|<noinclude>2</noinclude>0}}} / {{{total|100}}}) * 100 round 1}}%'''
 
   '''{{#expr: ( {{{1|<noinclude>2</noinclude>0}}} / {{{total|100}}}) * 100 round 1}}%'''
   {{{text|completed <small>(estimate)</small>}}}
+
   {{{text|completed <small></small>}}}
 
   </p>
 
   </p>
 
}}
 
}}
Line 24: Line 24:
 
     ">&nbsp;</span>
 
     ">&nbsp;</span>
 
</p>
 
</p>
</div>
+
</div></includeonly>
 
<noinclude>
 
<noinclude>
 +
Use as follows:<br />
 +
 +
<code><nowiki>{{Progress_bar|<numeric value>|total=<numeric value>}}</nowiki></code><br />
 +
 +
E.g.:<br />
 +
 +
<code><nowiki>{{Progress_bar|14|total=200}}</nowiki></code><br />
 +
 +
gives this:<br />
 +
 +
{{Progress_bar|14|total=200}}<br />
 +
<br />
 +
Other configurable parameters:
 
* height =
 
* height =
 
* width = defaults to 75%
 
* width = defaults to 75%

Revision as of 11:09, 15 January 2018


Use as follows:

{{Progress_bar|<numeric value>|total=<numeric value>}}

E.g.:

{{Progress_bar|14|total=200}}

gives this:

7% completed

   



Other configurable parameters:

  • height =
  • width = defaults to 75%
  • text = message to display after %; defaults to: completed (estimate)
  • total = amount to use as the denominator (instead of 100), allows the template to compute the percentage on the fly
  • header = no (or any value other than "yes", which is the default) suppresses the display of the percentage on the top line