Module:Sprite grid

local p = {} function p.grid( f ) local args = f:getParent.args local rows = {} local sprite = require( 'Module:Sprite' ).sprite local default = 384 local spriteArgs = { name = 'Block', sheetsize = 384, defaultpos = default }	for k, v in ipairs( args ) do		local row = {} for v2 in mw.text.gsplit( v:gsub( '\n+',  ),  ) do			if mw.text.trim( v2 ) == '' or args[v2] == 'air' then table.insert( row, ' style="width:16px;height:16px" | ' ) else spriteArgs[1] = args[v2] or default spriteArgs.link = spriteArgs[1] if tonumber( spriteArgs[1] ) then spriteArgs.link = false end table.insert( row, sprite( spriteArgs ) ) end end table.insert( rows, table.concat( row, ' || ' ) ) end return '{| cellspacing="0" cellpadding="0" style="line-height:0"\n| ' .. table.concat( rows, '\n|-\n| ' ) .. '\n|}' end return p