Modul:Benutzer:XanonymusX
Erscheinungsbild
Die Dokumentation für dieses Modul kann unter Modul:Benutzer:XanonymusX/Doku erstellt werden
--
-- Created by IntelliJ IDEA.
-- User: patricklanzinger
-- Date: 17.03.15
-- Time: 00:24
-- To change this template use File | Settings | File Templates.
--
local checkeven = {}
function checkeven.iseven(frame)
if(frame.args[1] % 2 == 0) then
return 0
else
return 1
end
end
function checkeven.createtable(frame)
rows = tonumber(frame.args[1])
collums = tonumber(frame.args[2])
color_odd = frame.args[3]
color_even = frame.args[4]
temp_count = 0
array = {}
wikimedia = ""
for i in string.gmatch(frame.args[5], "%S+") do
array[temp_count] = i
temp_count = temp_count + 1
end
temp_count = 0
for k = 0,rows,1 do
if (k % 2) == 0 then
wikimedia = wikimedia.."|-style=\"background-color:\"..color_even..\"}}\n|"
else
wikimedia = wikimedia.."|-style=\"background-color:\"..color_odd..\"}}\n|"
end
for j = 0,collums, 1 do
x = array[temp_count]
if j == (collums) then
wikimedia = wikimedia..tostring(x)
else
wikimedia = wikimedia..tostring(x)
wikimedia = wikimedia.."|||"
end
temp_count = temp_count + 1
end
end
return wikimedia
end
return checkeven