From GamingWiki
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:
 
-->}}<!--
 
-->}}<!--
  
--><nowiki/>
+
-->{{#vardefine: columns | {{{columns|6}}} }}<!--
{{!}} colspan="{{{columns|6}}}" class="subhead" {{!}} {{{1|no section header text}}} <!--
+
 
 +
  Loop over the numbers 1..{{{columns}}}:
 +
-->{{#loop: colnum | 1 | {{#var: columns}} |<!--
 +
  -->{{#ifeq:{{{{{#var:colnum}}|}}}||<!--
 +
 
 +
        Positional header not empty
 +
      -->|{{#vardefine: colspan<!--
 +
        -->|{{{colspan{{#var:colnum}}|<!--
 +
 
 +
              No colspan declared
 +
            -->|{{#ifeq:{{{{{#expr:{{#var:colnum}}+1}}}}}|<!--
 +
 
 +
                  Here there is no colspan declared, and there is nothing in
 +
                  the next column. So we assume this is to take up the rest of
 +
                  the width of the table.
 +
              -->|{{#expr:{{#var:columns}}+1-{{#var:colnum}}}}<!--
 +
 
 +
                  Here there is no colspan declared, and something in the next
 +
                  column. So we set the colspan to 1.
 +
              -->|1<!--
 +
            -->}}<!--
 +
 
 +
        -->}}}<!--
 +
 
 +
      --><nowiki/>
 +
! colspan="{{#var:colspan}}" class="subhead" ! bar{{{{{#var:colnum}}}}}foo <!--
 +
 
 +
  -->}}<!--
 +
 
 +
-->}}<!--
  
 
--></onlyinclude>
 
--></onlyinclude>
 
|}
 
|}

Latest revision as of 01:33, 22 August 2014