From GamingWiki
m (Dave moved page Template:Character sheet/section header to Template:Character sheet/section subhead) |
|||
| Line 7: | Line 7: | ||
-->}}<!-- | -->}}<!-- | ||
| − | -->< | + | -->{{#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> | ||
|} | |} | ||