Difference between revisions of "User:B.Tay"
From MHWiki
m (Demo.v2) |
m (Demo v3.Added conditional column) |
||
| Line 1: | Line 1: | ||
<nowiki>{{ShopsTableHeader}}</nowiki> | <nowiki>{{ShopsTableHeader}}</nowiki> | ||
| − | <pre> | + | <pre> |
| − | + | <table style="margin: {{{Margin|1em}}}" class="sortable b_and_p"> | |
| − | + | <tr style="background-color: {{{HeaderRowColour|#dddddd}}}" class="sticky_table_row"> | |
| − | + | <th style="text-align: {{ifeq|{{{ItemAlignCenter|}}}|Yes|center|left}}" class="{{ifeq|{{{ItemSort|}}}|No|unsortable|}}">{{{ItemHeader|Item}}}</th> | |
| − | + | {{ifeq|1={{{NoteColumn|}}}|2=Yes|3=<th style="text-align: {{ifeq|{{{NoteAlignLeft|}}}|Yes|left|center}}" class="{{ifeq|{{{NoteSort|}}}|No|unsortable|}}">{{{NoteHeader|Note}}}</th>|4=}} | |
| − | + | <th style="text-align: {{ifeq|{{{CostAlignLeft|}}}|Yes|left|center}}" class="{{ifeq|{{{CostSort|}}}|No|unsortable|}}">{{{CostHeader|Cost}}}</th> | |
| + | <th style="text-align: {{ifeq|{{{RequirementAlignLeft|}}}|Yes|left|center}}" class="{{ifeq|{{{RequirementSort|}}}|No|unsortable|}}">{{{RequirementHeader|Requirement}}}</th> | ||
| + | <th style="text-align: {{ifeq|{{{RefundAlignLeft|}}}|Yes|left|center}}" class="{{ifeq|{{{RefundSort|}}}|No|unsortable|}}">{{{RefundHeader|Refund}}}</th> | ||
| + | </tr> | ||
| + | <tr> | ||
| + | <td>Foo</td> | ||
| + | {{ifeq|1={{{NoteColumn|}}}|2=Yes|3=<td>Foo</td>|4=}} | ||
| + | <td>Foo</td> | ||
| + | <td>Foo</td> | ||
| + | <td>Foo</td> | ||
| + | </tr> | ||
| + | <tr> | ||
| + | <td>RequirementsGalore</td> | ||
| + | {{ifeq|1={{{NoteColumn|}}}|2=Yes|3=<td>RequirementsGalore</td>|4=}} | ||
| + | <td>RequirementsGalore</td> | ||
| + | <td>RequirementsGalore</td> | ||
| + | <td>RequirementsGalore</td> | ||
| + | </tr> | ||
| + | </table> | ||
| + | </pre> | ||
To use: | To use: | ||
| Line 18: | Line 37: | ||
| ItemSort = Defaults to "" if left blank (sortable) , otherwise input "No" for "unsortable" | | ItemSort = Defaults to "" if left blank (sortable) , otherwise input "No" for "unsortable" | ||
| ItemHeader = Defaults to "Item" if left blank , otherwise as per editor input | | ItemHeader = Defaults to "Item" if left blank , otherwise as per editor input | ||
| + | | NoteColumn = Defaults to "" if left blank (no column) , otherwise input "Yes" for the Note column to appear | ||
| + | | NoteAlignLeft = Defaults to "center" if left blank , otherwise input "Yes" for "left" | ||
| + | | NoteSort = Defaults to "" if left blank (sortable) , otherwise input "No" for "unsortable" | ||
| + | | NoteHeader = Defaults to "Cost" if left blank , otherwise as per editor input | ||
| CostAlignLeft = Defaults to "center" if left blank , otherwise input "Yes" for "left" | | CostAlignLeft = Defaults to "center" if left blank , otherwise input "Yes" for "left" | ||
| CostSort = Defaults to "" if left blank (sortable) , otherwise input "No" for "unsortable" | | CostSort = Defaults to "" if left blank (sortable) , otherwise input "No" for "unsortable" | ||
| Line 31: | Line 54: | ||
Testing | Testing | ||
| − | + | <table style="margin: {{{Margin|1em}}}" class="sortable b_and_p"> | |
| − | + | <tr style="background-color: {{{HeaderRowColour|#dddddd}}}" class="sticky_table_row"> | |
| − | + | <th style="text-align: {{ifeq|{{{ItemAlignCenter|}}}|Yes|center|left}}" class="{{ifeq|{{{ItemSort|}}}|No|unsortable|}}">{{{ItemHeader|Item}}}</th> | |
| − | + | {{ifeq|1={{{NoteColumn|}}}|2=Yes|3=<th style="text-align: {{ifeq|{{{NoteAlignLeft|}}}|Yes|left|center}}" class="{{ifeq|{{{NoteSort|}}}|No|unsortable|}}">{{{NoteHeader|Note}}}</th>|4=}} | |
| − | + | <th style="text-align: {{ifeq|{{{CostAlignLeft|}}}|Yes|left|center}}" class="{{ifeq|{{{CostSort|}}}|No|unsortable|}}">{{{CostHeader|Cost}}}</th> | |
| − | + | <th style="text-align: {{ifeq|{{{RequirementAlignLeft|}}}|Yes|left|center}}" class="{{ifeq|{{{RequirementSort|}}}|No|unsortable|}}">{{{RequirementHeader|Requirement}}}</th> | |
| − | | | + | <th style="text-align: {{ifeq|{{{RefundAlignLeft|}}}|Yes|left|center}}" class="{{ifeq|{{{RefundSort|}}}|No|unsortable|}}">{{{RefundHeader|Refund}}}</th> |
| − | + | </tr> | |
| − | + | <tr> | |
| − | + | <td>Foo</td> | |
| − | + | {{ifeq|1={{{NoteColumn|}}}|2=Yes|3=<td>Foo</td>|4=}} | |
| − | |} | + | <td>Foo</td> |
| + | <td>Foo</td> | ||
| + | <td>Foo</td> | ||
| + | </tr> | ||
| + | <tr> | ||
| + | <td>RequirementsGalore</td> | ||
| + | {{ifeq|1={{{NoteColumn|}}}|2=Yes|3=<td>RequirementsGalore</td>|4=}} | ||
| + | <td>RequirementsGalore</td> | ||
| + | <td>RequirementsGalore</td> | ||
| + | <td>RequirementsGalore</td> | ||
| + | </tr> | ||
| + | </table> | ||
Revision as of 23:49, 18 February 2022
{{ShopsTableHeader}}
<table style="margin: {{{Margin|1em}}}" class="sortable b_and_p">
<tr style="background-color: {{{HeaderRowColour|#dddddd}}}" class="sticky_table_row">
<th style="text-align: {{ifeq|{{{ItemAlignCenter|}}}|Yes|center|left}}" class="{{ifeq|{{{ItemSort|}}}|No|unsortable|}}">{{{ItemHeader|Item}}}</th>
{{ifeq|1={{{NoteColumn|}}}|2=Yes|3=<th style="text-align: {{ifeq|{{{NoteAlignLeft|}}}|Yes|left|center}}" class="{{ifeq|{{{NoteSort|}}}|No|unsortable|}}">{{{NoteHeader|Note}}}</th>|4=}}
<th style="text-align: {{ifeq|{{{CostAlignLeft|}}}|Yes|left|center}}" class="{{ifeq|{{{CostSort|}}}|No|unsortable|}}">{{{CostHeader|Cost}}}</th>
<th style="text-align: {{ifeq|{{{RequirementAlignLeft|}}}|Yes|left|center}}" class="{{ifeq|{{{RequirementSort|}}}|No|unsortable|}}">{{{RequirementHeader|Requirement}}}</th>
<th style="text-align: {{ifeq|{{{RefundAlignLeft|}}}|Yes|left|center}}" class="{{ifeq|{{{RefundSort|}}}|No|unsortable|}}">{{{RefundHeader|Refund}}}</th>
</tr>
<tr>
<td>Foo</td>
{{ifeq|1={{{NoteColumn|}}}|2=Yes|3=<td>Foo</td>|4=}}
<td>Foo</td>
<td>Foo</td>
<td>Foo</td>
</tr>
<tr>
<td>RequirementsGalore</td>
{{ifeq|1={{{NoteColumn|}}}|2=Yes|3=<td>RequirementsGalore</td>|4=}}
<td>RequirementsGalore</td>
<td>RequirementsGalore</td>
<td>RequirementsGalore</td>
</tr>
</table>
To use:
{{ShopsTableHeader}}
FOR BT
{{ShopsTableHeader
| Margin = Defaults to "1em" if left blank (1em allaround), otherwise as per editor input
| HeaderRowColour = Defaults to "#dddddd" if left blank , otherwise as per editor input
| ItemAlignCenter = Defaults to "left" if left blank , otherwise input "Yes" for "center"
| ItemSort = Defaults to "" if left blank (sortable) , otherwise input "No" for "unsortable"
| ItemHeader = Defaults to "Item" if left blank , otherwise as per editor input
| NoteColumn = Defaults to "" if left blank (no column) , otherwise input "Yes" for the Note column to appear
| NoteAlignLeft = Defaults to "center" if left blank , otherwise input "Yes" for "left"
| NoteSort = Defaults to "" if left blank (sortable) , otherwise input "No" for "unsortable"
| NoteHeader = Defaults to "Cost" if left blank , otherwise as per editor input
| CostAlignLeft = Defaults to "center" if left blank , otherwise input "Yes" for "left"
| CostSort = Defaults to "" if left blank (sortable) , otherwise input "No" for "unsortable"
| CostHeader = Defaults to "Cost" if left blank , otherwise as per editor input
| RequirementAlignLeft = Defaults to "center" if left blank , otherwise input "Yes" for "left"
| RequirementSort = Defaults to "" if left blank (sortable) , otherwise input "No" for "unsortable"
| RequirementHeader = Defaults to "Requirement" if left blank , otherwise as per editor input
| RefundAlignLeft = Defaults to "center" if left blank , otherwise input "Yes" for "left"
| RefundSort = Defaults to "" if left blank (sortable) , otherwise input "No" for "unsortable"
| RefundHeader = Defaults to "Refund" if left blank , otherwise as per editor input
}}
Testing
| Item | Cost | Requirement | Refund |
|---|---|---|---|
| Foo | Foo | Foo | Foo |
| RequirementsGalore | RequirementsGalore | RequirementsGalore | RequirementsGalore |