From GamingWiki
(Created page with "{| class="infobox" <onlyinclude><!-- {{#ifeq:{{{break|yes}}}|yes|<!-- --><nowiki/> {{!}}- <!-- -->}}<!-- --><nowiki/> {{!}} colspan="{{{columns|6}}}" class="subhead" {{!}} ...") |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
<onlyinclude><!-- | <onlyinclude><!-- | ||
− | {{#ifeq:{{{break|yes}}}|yes|<!-- | + | -->{{#ifeq:{{{break|yes}}}|yes|<!-- |
− | |||
--><nowiki/> | --><nowiki/> | ||
{{!}}- <!-- | {{!}}- <!-- | ||
-->}}<!-- | -->}}<!-- | ||
− | -->< | + | -->{{#vardefine: columns | {{{columns|6}}} }}<!-- |
− | {{!}} colspan | + | |
+ | 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> | ||
|} | |} |