Module:MultiRow: Difference between revisions
Jump to navigation
Jump to search
(Created page with "local p = {} function p.countDelimiter(frame) local count = 1 for i in string.gfind(frame.args[1], "\n") do count = count + 1 end return count end function p.makeMulti...") |
No edit summary |
||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
function p.makeMultiRow(frame) | function p.makeMultiRow(frame) |
Latest revision as of 12:03, 21 July 2020
Documentation for this module may be created at Module:MultiRow/doc
local p = {}
function p.makeMultiRow(frame)
local count = 0
local rowName = frame.args['rowName']
local fullString = ""
local firstEntry = true
for index, value in ipairs(frame.args) do
if value ~= nil and value:match("%S") ~= nil then
if firstEntry then
fullString = "\n\| " .. value
firstEntry = false
else
fullString = fullString .. "\n\|-\n\| " .. value
end
count = count + 1
end
end
if count > 0 then
return "! rowspan=\"" .. count .. "\" \| " .. rowName .. fullString
else
return nil
end
end
return p