Difference between revisions of "Module:Tables"

Jump to navigation Jump to search
465 bytes added ,  18:00, 18 August 2022
no edit summary
Line 59: Line 59:
end
end
local production = {}
local production = ''
if c.requirements then  
if c.requirements then  
local reqs = ''
production = '\'\'\'Requires:\'\'\'<br />'
for k, v in pairs(c.requirements) do
for k, v in pairs(c.requirements) do
production = production .. i.icon(v, nil, nil, v, 'en') .. '<br />'
end
end
end
end
if c.products then
production = production ..'\'\'\'Produces:\'\'\'<br />'
for k, v in pairs(c.production) do
production = production .. i.icon(v, nil, nil, v, 'en') .. '<br />'
end
end
if not production == '' then
local l = string.len(production)
production = string.sub(production, 1, l - 6)
end
local newRow = mw.html.create('tr')
local newRow = mw.html.create('tr')
Line 75: Line 86:
:wikitext(preReq)
:wikitext(preReq)
:done()
:done()
:tag('td')
:wikitext(production)
:done()
buildingTable:node(newRow)
buildingTable:node(newRow)
end
end

Navigation menu