Difference between revisions of "Template:GroupTableColHeader"

From QWiki
m
m (Rolling back because this broke existing table headers)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>|-
+
<includeonly>|- style="background-color:#f2f2f2;"
!class="wikitable" style="width: 16px;"|<nowiki>#</nowiki> <!-- show place number in header cell -->
+
!style="width:16px;"|<small>#</small> <!-- show place number in header cell -->
!colspan="{{#expr:4-{{#if:{{{go|}}}|1|0}}-{{#if:{{{win_g|}}}{{{lose_g|}}}|1|0}}-{{#if:{{{diff|}}}|1|0}}}}" style="text-align:left;" class="grouptableslot"| Team <!-- show the player name with the correct colspan -->
+
!colspan="{{#expr:3-{{#if:{{{win_m|}}}{{{lose_m|}}}|1|0}}-{{#if:{{{win_g|}}}{{{lose_g|}}}|1|0}}-{{#if:{{{diff|}}}|1|0}}}}" style="text-align:left;" class="grouptableslot"| <small>{{{1|}}}</small> <!-- show the player name with the correct colspan -->
{{#if: {{{go|}}} <!-- if go= is present, add a cell and show the arrow -->
+
!<!--class="grouptable-games" -->style="width: 35px; white-space: pre; text-align:center;"|'''{{{win_m|<small>Games</small>}}}''' <!-- always show match scores --><!--
    ! {{!}}style="width: 1em;"{{!}}<!-- go= with values "up", "same" and "down"
+
-->{{!}}{{!}}<!--class="grouptable-games" -->style="width: 35px; white-space: pre; text-align:center;"{{!}}{{{win_g|<small>Maps</small>}}}<!--
    -->{{#switch: {{{go}}}
 
        |up = {{PlaceUp}}
 
        |up1 = {{PlaceUp}}&nbsp;+1
 
        |up2 = {{PlaceUp}}&nbsp;+2
 
        |up3 = {{PlaceUp}}&nbsp;+3
 
        |up4 = {{PlaceUp}}&nbsp;+4
 
        |up5 = {{PlaceUp}}&nbsp;+5
 
        |up6 = {{PlaceUp}}&nbsp;+6
 
        |up7 = {{PlaceUp}}&nbsp;+7
 
        |same = {{PlaceSame}}
 
        |same0 = {{PlaceSame}}&nbsp;–
 
        |down = {{PlaceDown}}
 
        |down1 = {{PlaceDown}}&nbsp;-1
 
        |down2 = {{PlaceDown}}&nbsp;-2
 
        |down3 = {{PlaceDown}}&nbsp;-3
 
        |down4 = {{PlaceDown}}&nbsp;-4
 
        |down5 = {{PlaceDown}}&nbsp;-5
 
        |down6 = {{PlaceDown}}&nbsp;-6
 
        |down7 = {{PlaceDown}}&nbsp;-7
 
        |{{{go}}}
 
      }}
 
    |
 
}}
 
!<!--class="grouptable-games" -->style="width: 35px; white-space: pre; text-align:center;"|'''{{{win_m|0}}}-{{#if:{{{tie_m|}}}|{{{tie_m|}}}-}}{{{lose_m|0}}}''' <!-- always show match scores --><!--
 
-->{{#if: {{{win_g|}}}{{{lose_g|}}} <!-- show games scores if present with win_g= or lose_g=
 
-->| {{!}}{{!}}<!--class="grouptable-games" -->style="width: 35px; white-space: pre; text-align:center;"{{!}}{{{win_g|0}}}-{{{lose_g|0}}}}}<!--
 
 
-->{{#if: {{{diff|}}} <!-- if diff= is present, show it as well  
 
-->{{#if: {{{diff|}}} <!-- if diff= is present, show it as well  
-->| {{!}}{{!}}<!--class="grouptable-games" -->style="width: 35px; white-space: pre; text-align: center;"{{!}}''{{{diff|}}}''
+
-->| {{!}}{{!}}<!--class="grouptable-games" -->style="width: 35px; white-space: pre; text-align: center;"{{!}}<small>{{abbr|Diff|Map difference}}</small>
 
}}{{#ifeq:{{lc:{{#var:show_points|}}}}|true<!-- if show_p present, show points   
 
}}{{#ifeq:{{lc:{{#var:show_points|}}}}|true<!-- if show_p present, show points   
 
-->| {{!}}{{!}}<!--class="grouptable-points"-->style="width: 32px; white-space: pre; text-align:center;"{{!}}<!--
 
-->| {{!}}{{!}}<!--class="grouptable-points"-->style="width: 32px; white-space: pre; text-align:center;"{{!}}<!--
-->{{#if: {{{win_m|}}}{{{lose_m|}}}<!-- if win_m or lose_m is present, calculate points  
+
-->{{#if: {{{win_m|0}}}{{{lose_m|0}}}<!-- if win_m or lose_m is present, calculate points  
 
   -->|  {{#if: {{{tie_m|}}}<!-- if tie_m is present, include tie matches in calculation   
 
   -->|  {{#if: {{{tie_m|}}}<!-- if tie_m is present, include tie matches in calculation   
 
   -->| '''<i>{{#expr: ({{{win_m}}}*{{#var:win_points|3}}) + ({{#if:{{{tie_m|}}}|{{{tie_m}}}|0}}*{{#var:tie_points|1}}) + {{#if:{{{temp_p|}}}|{{{temp_p}}}|0}}}}p</i><!--
 
   -->| '''<i>{{#expr: ({{{win_m}}}*{{#var:win_points|3}}) + ({{#if:{{{tie_m|}}}|{{{tie_m}}}|0}}*{{#var:tie_points|1}}) + {{#if:{{{temp_p|}}}|{{{temp_p}}}|0}}}}p</i><!--

Latest revision as of 08:38, 15 February 2021

Documentation (view - edit)

Adds a column header row to a group table. This template is used inbetween the templates {{GroupTableStart}} and {{GroupTableSlot}}, which have to end with with {{GroupTableEnd}}).

Example #1

{{GroupTableStart|GroupTableStart|width=100%}}
{{GroupTableColHeader|Nation|games=1|maps=1|diff=1}}
{{GroupTableEnd}}

Gives us:

GroupTableStart
# Nation Games Maps Diff

Example #1

{{GroupTableStart|GroupTableStart|width=100%}}
{{GroupTableColHeader|Nation|games=1|maps=1|diff=}}
{{GroupTableEnd}}

Gives us:

GroupTableStart
# Nation Games Maps

Parameters

The following parameters can be used for this template

first unnamed argument
The first unnamed argument of the parameter list is used as the name of player column. Examples could be Player, Team or Nation.
|games=
(Optional) If not empty, it will display "Games" header
|maps=
(Optional) If not empty, it will display "Maps" header
|diff=
(Optional) If not empty, it will display "Diff" header