Please join this new Discord server!
Difference between revisions of "Module:StatsTable"
From Etrian Odyssey Wiki
m |
m |
||
Line 19: | Line 19: | ||
:done() | :done() | ||
-- Loop for each level to add the stats to the table | |||
for i = 1, 99 do | for i = 1, 99 do | ||
out_table:tag("tr") | out_table:tag("tr") | ||
Line 30: | Line 31: | ||
:tag("td"):wikitext(in_args[7 + (7 * (i - 1))]):done() | :tag("td"):wikitext(in_args[7 + (7 * (i - 1))]):done() | ||
:done() | :done() | ||
-- Show the headings again after every 10 levels, makes it easier to read | |||
if i % 10 == 0 then | |||
out_table:tag("tr") | |||
:tag("th"):css("width", "9%"):wikitext("Lv."):done() | |||
:tag("th"):css("width", "13%"):wikitext("HP"):done() | |||
:tag("th"):css("width", "13%"):wikitext("TP"):done() | |||
:tag("th"):css("width", "13%"):wikitext("STR"):done() | |||
:tag("th"):css("width", "13%"):wikitext("TEC"):done() | |||
:tag("th"):css("width", "13%"):wikitext("VIT"):done() | |||
:tag("th"):css("width", "13%"):wikitext("AGI"):done() | |||
:tag("th"):css("width", "13%"):wikitext("LUC"):done() | |||
:done() | |||
end | |||
end | end | ||
Revision as of 08:30, 13 January 2019
Documentation for this module may be created at Module:StatsTable/doc
local p = {}
function p.stats_table(frame)
-- Name input for convenience
local in_args = frame:getParent().args
-- Start building the output table
out_table = mw.html.create("table")
:addClass("wikitable"):css("width", "60%")
:tag("tr")
:tag("th"):css("width", "9%"):wikitext("Lv."):done()
:tag("th"):css("width", "13%"):wikitext("HP"):done()
:tag("th"):css("width", "13%"):wikitext("TP"):done()
:tag("th"):css("width", "13%"):wikitext("STR"):done()
:tag("th"):css("width", "13%"):wikitext("TEC"):done()
:tag("th"):css("width", "13%"):wikitext("VIT"):done()
:tag("th"):css("width", "13%"):wikitext("AGI"):done()
:tag("th"):css("width", "13%"):wikitext("LUC"):done()
:done()
-- Loop for each level to add the stats to the table
for i = 1, 99 do
out_table:tag("tr")
:tag("th"):wikitext(i):done()
:tag("td"):wikitext(in_args[1 + (7 * (i - 1))]):done()
:tag("td"):wikitext(in_args[2 + (7 * (i - 1))]):done()
:tag("td"):wikitext(in_args[3 + (7 * (i - 1))]):done()
:tag("td"):wikitext(in_args[4 + (7 * (i - 1))]):done()
:tag("td"):wikitext(in_args[5 + (7 * (i - 1))]):done()
:tag("td"):wikitext(in_args[6 + (7 * (i - 1))]):done()
:tag("td"):wikitext(in_args[7 + (7 * (i - 1))]):done()
:done()
-- Show the headings again after every 10 levels, makes it easier to read
if i % 10 == 0 then
out_table:tag("tr")
:tag("th"):css("width", "9%"):wikitext("Lv."):done()
:tag("th"):css("width", "13%"):wikitext("HP"):done()
:tag("th"):css("width", "13%"):wikitext("TP"):done()
:tag("th"):css("width", "13%"):wikitext("STR"):done()
:tag("th"):css("width", "13%"):wikitext("TEC"):done()
:tag("th"):css("width", "13%"):wikitext("VIT"):done()
:tag("th"):css("width", "13%"):wikitext("AGI"):done()
:tag("th"):css("width", "13%"):wikitext("LUC"):done()
:done()
end
end
return out_table:done()
end
return p