Difference between revisions of "Template:Ask Table Formatter/doc"
Jump to navigation
Jump to search
m (should be listed first) |
(close <div>) |
||
Line 11: | Line 11: | ||
== Examples == | == Examples == | ||
− | ===Example 1 - Basic === | + | === Example 1 - Basic === |
<pre> | <pre> | ||
<div><li style="display: inline-table;"> | <div><li style="display: inline-table;"> | ||
Line 18: | Line 18: | ||
|- | |- | ||
{{#ask: [[Category:Insectoid]] | {{#ask: [[Category:Insectoid]] | ||
− | | ?Meat Yield | + | | ?Meat Yield |
− | | format = template | + | | format = template |
− | | template = Ask Table Formatter | + | | template = Ask Table Formatter |
− | | link = none} | + | | link = none |
− | + | }} | |
− | </li><div> | + | </li></div> |
</pre> | </pre> | ||
Produces: | Produces: | ||
Line 31: | Line 31: | ||
|- | |- | ||
{{#ask: [[Category:Insectoid]] | {{#ask: [[Category:Insectoid]] | ||
− | | ?Meat Yield | + | | ?Meat Yield |
− | | format = template | + | | format = template |
− | | template = Ask Table Formatter | + | | template = Ask Table Formatter |
− | | link = none}} | + | | link = none |
+ | }} | ||
|} | |} | ||
− | </li><div> | + | </li></div> |
− | ===Example 2 - Ratios === | + | === Example 2 - Ratios === |
<pre> | <pre> | ||
<div><li style="display: inline-table;">{{#vardefine:formatterNumeratorVariable1|Daily Milk Average}}{{#vardefine:formatterDenominatorVariable1|Real Hunger Rate}} | <div><li style="display: inline-table;">{{#vardefine:formatterNumeratorVariable1|Daily Milk Average}}{{#vardefine:formatterDenominatorVariable1|Real Hunger Rate}} | ||
Line 45: | Line 46: | ||
|- | |- | ||
{{#ask: [[Concept:Production Animals]] [[Milk Amount::+]] [[Milk Name::Milk]] | {{#ask: [[Concept:Production Animals]] [[Milk Amount::+]] [[Milk Name::Milk]] | ||
− | | ?Milk Amount | + | | ?Milk Amount |
− | | ?Milking Interval Days | + | | ?Milking Interval Days |
− | | ?Daily Milk Average | + | | ?Daily Milk Average |
− | | format = template | + | | format = template |
− | | template = Ask Table Formatter | + | | template = Ask Table Formatter |
− | | link = none} | + | | link = none |
− | + | }} | |
− | </li><div> | + | </li></div> |
</pre> | </pre> | ||
Produces: | Produces: | ||
Line 61: | Line 62: | ||
|- | |- | ||
{{#ask: [[Concept:Production Animals]] [[Milk Amount::+]] [[Milk Name::Milk]] | {{#ask: [[Concept:Production Animals]] [[Milk Amount::+]] [[Milk Name::Milk]] | ||
− | | ?Milk Amount | + | | ?Milk Amount |
− | | ?Milking Interval Days | + | | ?Milking Interval Days |
− | | ?Daily Milk Average | + | | ?Daily Milk Average |
− | | format = template | + | | format = template |
− | | template = Ask Table Formatter | + | | template = Ask Table Formatter |
− | | link = none}} | + | | link = none |
+ | }} | ||
|} | |} | ||
− | </li><div> | + | </li></div> |
<noinclude>[[Category:Template documentation]]</noinclude> | <noinclude>[[Category:Template documentation]]</noinclude> | ||
<includeonly>[[Category:Customized table templates|#Ask Table Formatter]]</includeonly> | <includeonly>[[Category:Customized table templates|#Ask Table Formatter]]</includeonly> |
Revision as of 19:52, 17 November 2023
This template allows any table created by the "#ask" to use the Template: STDT formatting properly, including the shaded first cell.
Parameters
This template does not use traditional template parameters, instead it is fed up to 10 parameters to display by the #ask itself. Further, up to three ratios can be defined to be displayed as the final columns in the table be defining the following wiki variables
- Ratio 1 = formatterNumeratorVariable1/formatterDenominatorVariable1
- Ratio 2 = formatterNumeratorVariable2/formatterDenominatorVariable2
- Ratio 3 = formatterNumeratorVariable3/formatterDenominatorVariable3
Keep in mind the whitespace created when defining these variables on new lines.
Note: the #ask must also use the | link = none
parameter.
Examples
Example 1 - Basic
<div><li style="display: inline-table;"> {| {{STDT| sortable c_08 text-center}} ! Insectoid !! Meat Amount |- {{#ask: [[Category:Insectoid]] | ?Meat Yield | format = template | template = Ask Table Formatter | link = none }} </li></div>
Produces:
Insectoid | Meat Amount |
---|---|
Megascarab | 31 |
Megascarab cocoon | |
Megaspider | 168 |
Megaspider cocoon | |
Spelopede | 112 |
Spelopede cocoon |
Example 2 - Ratios
<div><li style="display: inline-table;">{{#vardefine:formatterNumeratorVariable1|Daily Milk Average}}{{#vardefine:formatterDenominatorVariable1|Real Hunger Rate}} {| {{STDT| sortable c_08 text-center}} ! Animal !! Milk Amount !! Milking Interval !! Daily Milk Average !! Daily Milk/Nutrition |- {{#ask: [[Concept:Production Animals]] [[Milk Amount::+]] [[Milk Name::Milk]] | ?Milk Amount | ?Milking Interval Days | ?Daily Milk Average | format = template | template = Ask Table Formatter | link = none }} </li></div>
Produces: