Template:CompositionBar: Difference between revisions

From EarthMC
Jump to navigation Jump to search
(Created page with "<noinclude> This template creates a single horizontal bar that visually represents a percentage or value relative to a total, similar to how the Wikipedia `Template:Composition_bar` can be used for a single metric. ```wiki {{#tag:syntaxhighlight| <div class="composition-bar-wrapper" style=" {{#if:{{{width|}}}|width:{{{width}}};|width:100px;}} {{#if:{{{float|}}}|float:{{{float}}};}} margin-left:auto; margin-right:0; →‎Default align right: border:{{{5|{{{border...")
 
No edit summary
Line 1: Line 1:
<noinclude>
<noinclude>
This template creates a single horizontal bar that visually represents a percentage or value relative to a total, similar to how the Wikipedia `Template:Composition_bar` can be used for a single metric.
This template creates a single horizontal bar that visually represents a percentage or value relative to a total, similar to how the Wikipedia `Template:Composition_bar` can be used for a single metric.
== Usage ==
To use this template, copy the following code to a page named `Template:CompositionBar` (or a similar name of your choice):


```wiki
```wiki
Line 23: Line 26:
   </div>
   </div>
</div>
</div>


Example:
Example:

Revision as of 05:12, 24 July 2025

This template creates a single horizontal bar that visually represents a percentage or value relative to a total, similar to how the Wikipedia `Template:Composition_bar` can be used for a single metric.

Usage

To use this template, copy the following code to a page named `Template:CompositionBar` (or a similar name of your choice):

```wiki {{#tag:syntaxhighlight|

 <div class="composition-bar-fill" style="
   width:Expression error: Unrecognized punctuation character "{".%;
   background-color:#4CAF50;
   color:white;
 ">
   
     Expression error: Unrecognized punctuation character "{".%
   


Example: