Module:Sandbox/Jbzdarkid/NecroTable
Appearance
local p = {}
function p.table(frame)
local output = '<table cellpadding="0" style="margin:0px; border:1px; border-color:black; border-collapse:collapse; background-color:lightgray; text-align:center"><tr>'
for j = 1, #frame.args['grid'] do
local chr = str:byte(j)
if (chr == string.byte(" ")) then row = row .. '<td></td>' end
if (chr == string.byte("^")) then row = row .. '<td style="background-color:skyblue;">↑</td>' end
if (chr == string.byte("v")) then row = row .. '<td style="background-color:skyblue;">↓</td>' end
if (chr == string.byte("<")) then row = row .. '<td style="background-color:skyblue;">←</td>' end
if (chr == string.byte(">")) then row = row .. '<td style="background-color:skyblue;">→</td>' end
if (chr == string.byte("\n")) then row = row .. '</tr><tr>' end
if (chr >= string.byte("1") and chr <= string.byte("9")) then
local ord = chr - string.byte("0")
row = row .. '<td style="background-color:' .. frame.args['color-' .. ord] .. '">[[File:' .. frame.args['image-' .. ord] .. '|24x24px]]</td>'
end
end
output = output .. '</tr></table>'
return output
end
return p