Template:Percentage bar: Difference between revisions
Template page
More actions
Created page with "<templatestyles src="Percentage bar/styles.css"/><div class="percentage-bar" style="{{#if:{{{border-width|}}}{{{border-color|}}}|border: {{{border-width|1px}}} solid {{{border-color|#aaa}}};}} {{#if:{{{background-color|}}}|background-color: {{{background-color}}};}} {{#if:{{{width|}}}|width: {{digits|{{{width|100}}}}}{{#if:{{str endswith|{{{width}}}|%}}|%|px}};}}"><div class="percentage-bar-fill" style="{{#if:{{{c|{{{hex|{{{3|}}}}}}}}}|background-color:{{{c|#{{{hex|{{{3}..." |
No edit summary |
||
Line 1: | Line 1: | ||
<templatestyles src="Percentage bar/styles.css"/><div class="percentage-bar" style="{{#if:{{{border-width|}}}{{{border-color|}}}|border: {{{border-width|1px}}} solid {{{border-color|#aaa}}};}} {{#if:{{{background-color|}}}|background-color: {{{background-color}}};}} {{#if:{{{width|}}}|width: {{digits|{{{width|100}}}}}{{#if:{{str endswith|{{{width}}}|%}}|%|px}};}}"><div class="percentage-bar-fill" style="{{#if:{{{c|{{{hex|{{{3|}}}}}}}}}|background-color:{{{c|#{{{hex|{{{3}}}}}}}}};}} {{#if:{{{1|}}}|width: {{#expr:floor({{#invoke:String|replace|source={{{1}}}|pattern=[a-zA-Z]+|plain=false}})}}%;}}"></div><div class="percentage-bar-text" style="{{#if:{{{weight|}}}|font-weight: {{{weight}}};}} {{#if:{{{align|}}}|text-align: {{{align}}};}} {{#if:{{{color|}}}|color: {{{color}}};}}">{{{2|{{formatnum:{{{1|50}}}}}%}}}</div></div><noinclude> | <templatestyles src="Template:Percentage bar/styles.css"/><div class="percentage-bar" style="{{#if:{{{border-width|}}}{{{border-color|}}}|border: {{{border-width|1px}}} solid {{{border-color|#aaa}}};}} {{#if:{{{background-color|}}}|background-color: {{{background-color}}};}} {{#if:{{{width|}}}|width: {{digits|{{{width|100}}}}}{{#if:{{str endswith|{{{width}}}|%}}|%|px}};}}"><div class="percentage-bar-fill" style="{{#if:{{{c|{{{hex|{{{3|}}}}}}}}}|background-color:{{{c|#{{{hex|{{{3}}}}}}}}};}} {{#if:{{{1|}}}|width: {{#expr:floor({{#invoke:String|replace|source={{{1}}}|pattern=[a-zA-Z]+|plain=false}})}}%;}}"></div><div class="percentage-bar-text" style="{{#if:{{{weight|}}}|font-weight: {{{weight}}};}} {{#if:{{{align|}}}|text-align: {{{align}}};}} {{#if:{{{color|}}}|color: {{{color}}};}}">{{{2|{{formatnum:{{{1|50}}}}}%}}}</div></div><noinclude> | ||
{{Documentation}} | {{Documentation}} | ||
<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES TO THE /doc SUBPAGE, THANKS --> | <!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES TO THE /doc SUBPAGE, THANKS --> | ||
</noinclude> | </noinclude> |
Latest revision as of 00:08, 16 March 2025
This template uses TemplateStyles: |
Usage
{{Percentage bar|50}}
→{{Percentage bar|50|label}}
→{{Percentage bar|50|}}
→{{Percentage bar|50||FF0000}}
→{{Percentage bar|50|hex=FF0000}}
→{{Percentage bar|50|c=red}}
→{{Percentage bar|50|hex=FF0000}}
→{{Percentage bar|50|c=red}}
→{{Percentage bar|0}}
→{{Percentage bar|100}}
→{{Percentage bar|50|width=200}}
→
- Relative width
{{Percentage bar|50|width=25%}}
→{{Percentage bar|50|width=55%}}
→{{Percentage bar|50|width=75%}}
→{{Percentage bar|50|width=100%}}
→
Other
{{Percentage bar|50.5}}
→{{Percentage bar|50.5|width=100%}}
→