Module:Infobox: Difference between revisions

Plumtree (talk | contribs)
mNo edit summary
Plumtree (talk | contribs)
m colspan=2 support
Line 32: Line 32:
s = s .. '\n'
s = s .. '\n'
for i, entry in ipairs(entries) do
for i, entry in ipairs(entries) do
local caption = entry[1]
if #entry > 1 then
local text = entry[2]
local caption = entry[1]
s = s .. '|-\n' ..
local text = entry[2]
'| style="text-align:right; padding-right: 0.25em" | ' .. caption .. '\n' ..
s = s .. '|-\n' ..
'| style="background-color: white; padding-left: 0.25em; font-weight: bold" | ' .. text .. '\n'
'| style="text-align:right; padding-right: 0.25em" | ' .. caption .. '\n' ..
'| style="background-color: white; padding-left: 0.25em; font-weight: bold" | ' .. text .. '\n'
elseif #entry == 1 then
local text = entry[1]
s = s .. '|-\n'
.. '| colspan="2" style="text-align: center;" | ' .. text .. '\n'
end
end
end
s = s .. '|}</div>'
s = s .. '|}</div>'