Module:Infobox: Difference between revisions

Ganaram inukshuk (talk | contribs)
m bugfix
Ganaram inukshuk (talk | contribs)
bugfix
Line 208: Line 208:
-- Set row count to 30, under the reasoning that an infobox may need more
-- Set row count to 30, under the reasoning that an infobox may need more
-- rows and/or headers. This may be increased to 40 if needed.
-- rows and/or headers. This may be increased to 40 if needed.
local rows = {}
args["Rows"] = tiu.header_data_pairs_to_table(args, 30)
args["Rows"] = tiu.header_data_pairs_to_table(args, 30)
--[[
for i = 1, 30 do
local header = args["Header " .. i]
local data  = args["Data "  .. i]
local row = nil
if (header == nil and data ~= nil) then
row = {}
table.insert(row, data)
elseif (header ~= nil and data ~= nil) then
row = {}
table.insert(row, header)
table.insert(row, data)
end
if row ~= nil then
table.insert(rows, row)
end
-- Remove original entries as cleanup
args["Header " .. i] = nil
args["Data "  .. i] = nil
end
]]--
args["Rows"] = rows