From GamingWiki
(4 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
-->{{#ifeq:{{{break|yes}}}|yes|<!-- | -->{{#ifeq:{{{break|yes}}}|yes|<!-- | ||
--><nowiki/> | --><nowiki/> | ||
− | {{!}}- | + | {{!}}- <!-- |
− | <!-- | ||
-->}}<!-- | -->}}<!-- | ||
− | -->{{!}} colspan | + | -->{{#vardefine: columns | {{{columns|6}}} }}<!-- |
+ | |||
+ | 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> | ||
|} | |} |