Module:HallOfFormsTable

local Util = require 'Module:Util' local cargo = mw.ext.cargo local Datetime = require 'Module:DatetimeUtil' local p = {}

function p.main(frame) local tbl = mw.html.create("table") :addClass("wikitable") :addClass("default") :css("text-align","center") local header = tbl:tag("tr") header:tag("th") :wikitext("Image") header:tag("th") :wikitext("Page") header:tag("th") :wikitext("Event Dates") header:tag("th") :wikitext("Forma") for k,v in ipairs(cargo.query( "HallOfForms=hf,HallOfForms__Forma=f", "hf._pageName=pgname,hf.Image=img,GROUP_CONCAT(DISTINCT f._value SEPARATOR ',')=flist,hf.StartTime=st,hf.EndTime=et", {			join = "hf._ID=f._rowID", orderBy = "hf.Number", groupBy="hf._pageName", limit=9000 }	)) do		local row = tbl:tag("tr") local forma = {} row:tag("td"):wikitext("") row:tag("td"):wikitext(""..v["pgname"].."") row:tag("td"):wikitext(Datetime.ht_range(v.st, v.et)) for f in mw.text.gsplit(v["flist"], ",") do			forma[#forma+1] = frame:expandTemplate{ title = "Ui", args = { name = f, size = "52px" } } end row:tag("td"):wikitext(table.concat(forma, " ")) end return tbl end return p