Modèle:Variation en tableau

Une page de Wikipédia, l'encyclopédie libre.

 Documentation[voir] [modifier] [historique] [purger]

Ce modèle calcule la variation en pourcentages entre deux valeurs de nombres réels et affiche le résultat sous forme de colonnes de tableau triable.

Syntaxe de ce modèle :

{{Variation en tableau|1st No.|2nd No.|dec=rounding|pre=prefix|suf=suffix|sort=on/off|italics=on/off|bold=on/off|invert=on/off|disp=row/out|rowspan=rowspan|align=alignment|bgcolour=background colour}}

paramètre fonction
1 1st No. is the first number displayed representing the base value.
2 2nd No. is the second number displayed representing the object value.
dec This is the number of decimal places to round the percentage change to.
pre This adds a prefix to the first and second numbers.
pre1 This adds a prefix to the first number.
pre2 This adds a prefix to the second number.
suf This adds a suffix to the first and second numbers.
suf1 This adds a suffix to the first number.
suf2 This adds a suffix to the second number.
sort This adds or removes the (tl)-compatible sort key from the first two cells. The default is only to add this if a prefix or suffix is used (i.e. only if needed).
italics This can either have the value of on or off. italics=on makes the output italic. The default is italics=off.
bold This can either have the value of on or off. bolds=on makes the output bold. The default is bold=off.
invert This can either have the value of on or off. invert=on switches the base and object values in the calculation of percentage change. The default is invert=off.
align This adjusts the alignment of text in cells. align=center and align=left aligns the text to the centre and left respectively. The default is align=right.
rowspan This adjust the row span of cells. The default is rowspan=1.
bgcolour This adjusts the background colour of cells. The default is bgcolour=#F9F9F9 (light grey).
disp This controls what is output. disp=out produces the percentage change only (and thus align, rowspan and bgcolour do not work with disp=out). The default is disp=row which produces three cells in a table row.

The following sortable tables illustrate the use of this template.

Wiki markup Tables
{|class="wikitable sortable"
!Region
!first
!second
!change
|-
|Big Meadow
|{{Variation en tableau|1830000|1900679.75}}
|-
|Little Meadow
|{{Variation en tableau|400000|500000}}
|-
|Mount Acme
|{{Variation en tableau|2450000|2205678.37}}
|-
|Acmevale North
|{{Variation en tableau|1250000|1000000|rowspan=2}}
|-
|Acmevale South
|-
|Homeport
|{{Variation en tableau|5120000|5589462.60|dec=0}}
|-
|Longwood
|{{Variation en tableau|930000|930027.92|dec=3}}
|-
|Meadowbrook
|{{Variation en tableau|2450000|2450000.00|pre=$}}
|-
|Johnstown
|{{Variation en tableau|3400000|3902340.05|suf= kg}}
|-
|Lakewood
|{{Variation en tableau|2250000|2236005.56|align=center}}
|-
| style="background-color:lightblue" |Fox Hollow
|{{Variation en tableau|1180000|1190345.32|bgcolour=lightblue}}
|-
|Riverton
|{{Variation en tableau|10550000|11236005.55|bold=on}}
|-
|Timber Creek
|{{Variation en tableau|1360000|1310948.30|italics=on}}
|-
|Terminated
|{{Variation en tableau|1500|0.00|bold=on|italics=on}}
|-
|Upstart
|{{Variation en tableau|0|26250.50|align=left}}
|-
|}
Without extra code
Region first second change
Big Meadow Modèle:Variation en tableau/rowIoffSoff
Little Meadow Modèle:Variation en tableau/rowIoffSoff
Mount Acme Modèle:Variation en tableau/rowIoffSoff
Acmevale North Modèle:Variation en tableau/rowIoffSoff
Acmevale South
Homeport Modèle:Variation en tableau/rowIoffSoff
Longwood Modèle:Variation en tableau/rowIoffSoff
Meadowbrook Modèle:Variation en tableau/rowIoffSon
Johnstown Modèle:Variation en tableau/rowIoffSon
Lakewood Modèle:Variation en tableau/rowIoffSoff
Fox Hollow Modèle:Variation en tableau/rowIoffSoff
Riverton Modèle:Variation en tableau/rowIoffSoff
Timber Creek Modèle:Variation en tableau/rowIoffSoff
Terminated Modèle:Variation en tableau/rowIoffSoff
Upstart Modèle:Variation en tableau/rowIoffSoff
With |disp=out
Region change
Big Meadow Modèle:Variation en tableau/outIoffSoff
Little Meadow Modèle:Variation en tableau/outIoffSoff
Mount Acme Modèle:Variation en tableau/outIoffSoff
Acmevale North Modèle:Variation en tableau/outIoffSoff
Acmevale South
Homeport Modèle:Variation en tableau/outIoffSoff
Longwood Modèle:Variation en tableau/outIoffSoff
Meadowbrook Modèle:Variation en tableau/outIoffSon
Johnstown Modèle:Variation en tableau/outIoffSon
Lakewood Modèle:Variation en tableau/outIoffSoff
Fox Hollow Modèle:Variation en tableau/outIoffSoff
Riverton Modèle:Variation en tableau/outIoffSoff
Timber Creek Modèle:Variation en tableau/outIoffSoff
Terminated Modèle:Variation en tableau/outIoffSoff
Upstart Modèle:Variation en tableau/outIoffSoff
With |invert=on
Region first second change
Big Meadow 1 830 000 1 900 679,75 −3,72%
Little Meadow 400 000 500 000 −20,00%
Mount Acme 2 450 000 2 205 678,37 +11,08%
Acmevale North 1 250 000 1 000 000 +25,00%
Acmevale South
Homeport 5 120 000 5 589 462,60 −8%
Longwood 930 000 930 027,92 −0,003%
Meadowbrook Modèle:Variation en tableau/rowIonSon
Johnstown Modèle:Variation en tableau/rowIonSon
Lakewood 2 250 000 2 236 005,56 +0,63%
Fox Hollow 1 180 000 1 190 345,32 −0,87%
Riverton 10 550 000 11 236 005,55 −6,11%
Timber Creek 1 360 000 1 310 948,30 +3,74%
Terminated 1 500 0,00 NA
Upstart 0 26 250,50 −100,00%
With |invert=on and |disp=out
Region change
Big Meadow Modèle:Variation en tableau/outIonSoff
Little Meadow Modèle:Variation en tableau/outIonSoff
Mount Acme Modèle:Variation en tableau/outIonSoff
Acmevale North Modèle:Variation en tableau/outIonSoff
Acmevale South
Homeport Modèle:Variation en tableau/outIonSoff
Longwood Modèle:Variation en tableau/outIonSoff
Meadowbrook 0,00%
Johnstown −12,87%
Lakewood Modèle:Variation en tableau/outIonSoff
Fox Hollow Modèle:Variation en tableau/outIonSoff
Riverton Modèle:Variation en tableau/outIonSoff
Timber Creek Modèle:Variation en tableau/outIonSoff
Terminated Modèle:Variation en tableau/outIonSoff
Upstart Modèle:Variation en tableau/outIonSoff

This template uses Module:Math and Template:ntsh, and produces a sort compatible with Template:nts and Template:ntsh.

Utilisation et paramètres[modifier le code]

Description du rôle de ce modèle à compléter. Insérer le code Templatedata dans cette section

Avec le wikicode Avec l’éditeur visuel

Cliquez sur « Modifier le code » et insérez la syntaxe suivante

  • {{Variation en tableau|paramètre1|nom1param=valeur1}}
  1. Cliquez sur modifier. L'éditeur visuel s'ouvre.
  2. Insérer
  3. Modèle
  4. Renseignez le modèle Variation en tableau dans le champ de recherche.
  5. Renseignez les champs concernés.
  6. Enregistrez.

Autre solution, quand vous modifiez une page ou discutez avec Discussions structurées :

  1. Tapez {{
  2. Renseignez le modèle Variation en tableau dans le champ de recherche.
  3. Renseignez les champs concernés.
  4. Enregistrez.

La plupart des modèles sont documentés directement dans l’éditeur visuel.
Aide générale de l’éditeur visuel à propos des modèles.

Exemple[modifier le code]

  • {{Variation en tableau|paramètre1|nom1param=valeur1}}

Modèle:Variation en tableau/rowIoffSoff