Please join this new Discord server!

Merge notice

Module:StatsTable

From Etrian Odyssey Wiki
Revision as of 00:47, 13 January 2019 by Moydow (talk | contribs)

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()
    
    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()
    end
    
    return out_table:done()
end

return p