Difference between revisions of "Template:Bartable"
From Gramps
(add back missing <includeonly>) |
(move example inline) |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
<includeonly>{{#if:{{{2|}}} | {{#if:{{#titleparts:{{{2}}}|1|2}}|{{#if:{{#titleparts:{{{2}}}|1|1}}|{{{1}}}{{{2}}}|{{convert|{{{1}}}|{{#titleparts:{{{2}}}|1|2}}|{{#titleparts:{{{2}}}|1|3}}|{{#titleparts:{{{2}}}|1|4}}|abbr=on}} }}|{{{1}}}{{{2}}} }} | {{{1|—}}} }} {{#ifexpr:{{#if:{{{3|}}}|{{{3}}}|0}}<0 | {{!}}{{!}} {{#ifexpr:{{formatnum:{{{1|0}}}|R}}<0 | align="right" {{!}} <div style="width:{{#expr:-abs({{#if:{{{3|}}}|{{{3}}}|1}})*{{formatnum:{{{1}}}|R}} }}px;height:{{#if:{{{4|}}}|{{{4}}}|2ex}};background:#aaa;{{{5|}}}"> </div>|}} | }} | <includeonly>{{#if:{{{2|}}} | {{#if:{{#titleparts:{{{2}}}|1|2}}|{{#if:{{#titleparts:{{{2}}}|1|1}}|{{{1}}}{{{2}}}|{{convert|{{{1}}}|{{#titleparts:{{{2}}}|1|2}}|{{#titleparts:{{{2}}}|1|3}}|{{#titleparts:{{{2}}}|1|4}}|abbr=on}} }}|{{{1}}}{{{2}}} }} | {{{1|—}}} }} {{#ifexpr:{{#if:{{{3|}}}|{{{3}}}|0}}<0 | {{!}}{{!}} {{#ifexpr:{{formatnum:{{{1|0}}}|R}}<0 | align="right" {{!}} <div style="width:{{#expr:-abs({{#if:{{{3|}}}|{{{3}}}|1}})*{{formatnum:{{{1}}}|R}} }}px;height:{{#if:{{{4|}}}|{{{4}}}|2ex}};background:#aaa;{{{5|}}}"> </div>|}} | }} | ||
| − | | {{#ifexpr:{{formatnum:{{{1|0}}}|R}}>0 | align="left" {{!}} <div style="width:{{#expr:abs({{#if:{{{3|}}}|{{{3}}}|1}})*{{formatnum:{{{1}}}|R}} }}px;height:{{#if:{{{4|}}}|{{{4}}}|2ex}};background:#aaa;{{{5|}}}"> </div>|}}</includeonly><noinclude><br><br>This template adds an inline bar graph to tables with numeric (including negative) values that a reader may wish to compare.<br>Use this template inside a table.<br><br>Copy of [ | + | | {{#ifexpr:{{formatnum:{{{1|0}}}|R}}>0 | align="left" {{!}} <div style="width:{{#expr:abs({{#if:{{{3|}}}|{{{3}}}|1}})*{{formatnum:{{{1}}}|R}} }}px;height:{{#if:{{{4|}}}|{{{4}}}|2ex}};background:#aaa;{{{5|}}}"> </div>|}}</includeonly><noinclude><br><br>This template adds an inline bar graph to tables with numeric (including negative) values that a reader may wish to compare.<br>Use this template inside a table.<br>See the [[Template:Bartable\example]] |
| + | |||
| + | {| {{prettytable}} | ||
| + | | colspan=3 | | ||
| + | === Test === | ||
| + | |- | ||
| + | | english manual (95/95) || style='text-align:right' | {{bartable|100|%|2||background:green}} (bar appears here! when template works) | ||
| + | |- | ||
| + | | english manual (63/80) || style='text-align:right' | {{bartable|79|%|2}} | ||
| + | |- | ||
| + | | english manual (93/112) || style='text-align:right' | {{bartable|83|%|2}} | ||
| + | |- | ||
| + | |} | ||
| + | |||
| + | |||
| + | <br>Copy of [https://en.wikipedia.org/wiki/Template:Bartable Template:Bartable] From Wikipedia[[Category:Templates]]</noinclude> | ||
Latest revision as of 00:51, 19 May 2020
This template adds an inline bar graph to tables with numeric (including negative) values that a reader may wish to compare.
Use this template inside a table.
See the Template:Bartable\example
Test | ||
| english manual (95/95) | 100% | |
| english manual (63/80) | 79% | |
| english manual (93/112) | 83% | |
Copy of Template:Bartable From Wikipedia