Difference between revisions of "Template:Bartable"

From Gramps
(add back missing <includeonly>)
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|&mdash;}}} }} {{#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|}}}">&nbsp;</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|&mdash;}}} }} {{#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|}}}">&nbsp;</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|}}}">&nbsp;</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 [http://en.wikipedia.org/wiki/Template:Bartable Template:Bartable] From Wikipedia[[Category:Templates]]</noinclude>
+
| {{#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|}}}">&nbsp;</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 [http://www.gramps-project.org/wiki/index.php?title=Template:Bartable%5Cexample example]<br>Copy of [http://en.wikipedia.org/wiki/Template:Bartable Template:Bartable] From Wikipedia[[Category:Templates]]</noinclude>

Revision as of 22:03, 2 November 2011



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 example
Copy of Template:Bartable From Wikipedia