# [Lua], 205 bytes

<!-- language-all: lang-lua -->
```lua
load("t="..(...).."c=#t for i=1,c do c=math.max(c,#t[i])end p=load'io.stdout:write(...)'p'{'for i=1,c do for j=1,c do _=j==1 and p'{'p(t[i]and t[i][j]or 0)p(j==c and'}'or',')end _=i~=c and p','end p'}'")()
```

[Try it online!][TIO-ko9myncy]

[Lua]: https://www.lua.org/
[TIO-ko9myncy]: https://tio.run/##VY7RasMwDEXf8xXCfbANwiRt91Lwl5QSjJMxhzQ2rrMNTPbrmeyxsj1c5CudK2tezT57a2ZIoCE3ACxvDGvNG@btaVpsyVdheT8HHR7xhOc/DWKOpBPpjC91sDWvPkKP72ZeR3ALuGBcfIgkYfB0gRkES5opVQGlmNWHBCXjdIeWILD6btKbuptPYfGQru4mx2WAoEuaO68eafBrunxEl0ahlJI88Mz/7Shm@jW9nrTuwJQlBAZRdhZX6nW6EdvKIAiyBeIb95Ejr7/22n39tCmLvB5CAJNC7hCiW5KQDXX3bw "Lua – Try It Online"

### Human readable code:

<!-- language-all: lang-lua -->
```
load(
  "t="..(...)..
  "c=#t
   for i=1,c do
     c=math.max(c,#t[i])
   end
   p=load'io.stdout:write(...)'
   p'{'
   for i=1,c do 
     for j=1,c do
       _=j==1 and p'{'
       p(t[i]and t[i][j]or 0)
       p(j==c and'}'or',')
     end
     _=i~=c and p','
   end
   p'}'
  ")
()
```