Module:TableGenerator: Difference between revisionsGive feedback
mNo edit summary |
m removed if i>1 |
||
| Line 24: | Line 24: | ||
local count = 0 | local count = 0 | ||
for i, value in ipairs(args) do | for i, value in ipairs(args) do | ||
-- If it's the start of a new row | |||
if count % cols == 0 then | |||
if count > 0 then | |||
result = result .. ' </tr>\n' | |||
end | end | ||
result = result .. ' <tr>\n' | |||
end | |||
-- Add the value as a table cell | |||
result = result .. ' <td>' .. value .. '</td>\n' | |||
count = count + 1 | |||
end | end | ||