Difference between revisions of "Template:Alternating rows table section"
From Make a Good Mega Man Level Contest
(Created page with "{{#if:{{{1|}}}| {{!}}- style="{{{os|}}}" {{{1|}}} }} {{{{#if:{{{1|}}}|1x|void}}| }}{{#if:{{{2|}}}| {{!}}- style="{{#ifexpr: ({{ #ifeq: {{{1}}} || 0 | 1 }} ) mod 2 = 0 | {{{os|...") |
(No difference)
|
Latest revision as of 18:36, 13 October 2017
Usage
Alternating rows table section allows for the dynamic creation of tables that use alternating styles for odd and even numbered rows, typically in conjunction with a template which generates a table where some rows may not be present every time.
There are two named arguments to this template:
- os
- Defines the CSS style for odd-numbered rows.
- es
- Defines the CSS style for even-numbered rows.
Example
{| class="wikitable"
! Place !! Result
{{Alternating rows table section|es=background:#f0f0f0;
| {{!}} First {{!!}} 100
| {{!}} Second {{!!}} 95
| <!-- empty! -->
| {{!}} Third {{!!}} 87
| <!-- empty! -->
| {{!}} Fourth {{!!}} 65
| {{!}} Fifth {{!!}} 58
}}
|}
| Place | Result |
|---|---|
| First | 100 |
| Second | 95 |
| Third | 87 |
| Fourth | 65 |
| Fifth | 58 |