This creates the following structure -- all ok, except the table body, which is empty ('[]'), and I cannot get it to appear. Any suggestions on what I'm doing wrong would be gratefully received.
I've been struggling to get my head around handling tables with Lua in pandoc 2.18. I'm trying to write a minimal working example to create a table as I can't seem to find one online. The code below does create a table, but with any empty table body and I can't figure out how to get the body to appear. Can anyone help tell me what has gone wrong here?BTW, I tried to call the pandoc.TableBody() constructor, but that throws an error as it doesn't seem to be defined ("attempt to call a nil value (field 'TableBody')")
```
local caption = {long = {}}
local colspecs = {{pandoc.AlignLeft, pandoc.ColWidthDefault},
{pandoc.AlignDefault, pandoc.ColWidthDefault}}
local head = pandoc.TableHead()
local cell1contents = { pandoc.Plain({pandoc.Str("cell1")}) }
local cell2contents = { pandoc.Plain({pandoc.Str("cell2")}) }
local cell1 = { alignment=pandoc.AlignDefault, contents=cell1contents, col_span=1, row_span=1 }
local cell2 = { alignment=pandoc.AlignDefault, contents=cell2contents, col_span=1, row_span=1 }
local row1 = { cells={pandoc.Cell(cell1), pandoc.Cell(cell2)} }
local rows = { pandoc.Row(row1) }
local bodies = { body=rows, head={}, row_head_columns=0 }
local foot = pandoc.TableFoot()
local mytable = pandoc.Table(caption, colspecs, head, bodies, foot)
table.insert(doc.blocks, mytable)
```