Please join this new Discord server!

Merge notice

Module:StatsTable

From Etrian Odyssey Wiki
Revision as of 00:24, 13 January 2019 by Moydow (talk | contribs) (Created page with "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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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", "50%")
    	:tag("tr")
    		:tag("th"):css("width", "10%"):wikitext("Lv."):done()
    		:tag("th"):css("width", "18%"):wikitext("STR"):done()
    		:tag("th"):css("width", "18%"):wikitext("TEC"):done()
    		:tag("th"):css("width", "18%"):wikitext("VIT"):done()
    		:tag("th"):css("width", "18%"):wikitext("AGI"):done()
    		:tag("th"):css("width", "18%"):wikitext("LUC"):done()
    	:done()
    
    for i = 1, 99 do
    	out_table:tag("tr")
    		:tag("th"):wikitext(i):done()
    		:tag("td"):wikitext(in_args[1 + (5 * (i - 1))]):done()
    		:tag("td"):wikitext(in_args[2 + (5 * (i - 1))]):done()
    		:tag("td"):wikitext(in_args[3 + (5 * (i - 1))]):done()
    		:tag("td"):wikitext(in_args[4 + (5 * (i - 1))]):done()
    		:tag("td"):wikitext(in_args[5 + (5 * (i - 1))]):done()
    	:done()
    end
    
    return out_table:done()
end

return p