Module:Loom

-- local p = {}

local Shared = require(Module:Shared)

function p.statTable local Loom	= mw.loadData(Module:Loom/data) local tableNode	= mw.html.create('table') :addClass('sortable article-table sticky-header mw-collapsible') :css('width', '100%') :css('text-align', 'center') :tag('tr') :tag('th'):wikitext('Name'):done :tag('th'):wikitext('Tier'):done :tag('th'):wikitext('Category'):done :tag('th'):wikitext('Resources'):done :tag('th'):wikitext('Yield'):done :tag('th'):wikitext('Station Lvl'):done :tag('th'):wikitext('Skill Level'):done :tag('th'):wikitext('Crafting Skill'):done :tag('th'):wikitext('Crafting Exp'):done

for name, Loom in Shared.skpairs(Loom, function(a, b) return Loom[a]["SkillLevel"] < Loom[b]["SkillLevel"] end) do   --for name, Loom in Shared.skpairs(Loom) do        tableNode:tag('tr') :tag('td'):wikitext(..name..):done :tag('td'):wikitext(Loom.Tier):done :tag('td'):wikitext(Loom.Category):done :tag('td'):wikitext(Loom.Resources):done :tag('td'):wikitext(Loom.Yield):done :tag('td'):wikitext(Loom.StationLVL):done :tag('td'):wikitext(..Loom.SkillLevel..):done :tag('td'):wikitext(..Loom.CraftSkill..):done :tag('td'):wikitext(..Loom.CraftingXP..):done :done end

Shared.tableSort(tableNode, "Tier") return tostring(tableNode:allDone) end

return p --