document-builder
document-builder copied to clipboard
Problems nesting tables inside cells
Hello. I am trying to create a table with n rows where each row has two columns and each cell will contain a table.
If the table contains a single row i get what i am expecting
But if I add more rows the rows are overlapped
This is the code i am trying
`PdfDocumentBuilder builder = new PdfDocumentBuilder(response.outputStream)
builder.create {
document {
table {
row {
cell {
table {
row {
cell 'cell1'
cell 'cell2'
}
row {
cell 'cell3'
cell 'cell4'
}
}
}
cell {
table {
row {
cell 'cell1'
cell 'cell2'
}
row {
cell 'cell3'
cell 'cell4'
}
}
}
}
row {
cell {
table {
row {
cell 'cell1'
cell 'cell2'
}
row {
cell 'cell3'
cell 'cell4'
}
}
}
cell {
table {
row {
cell 'cell1'
cell 'cell2'
}
row {
cell 'cell3'
cell 'cell4'
}
}
}
}
}
}
}
response.contentType = "application/pdf"
response.setHeader("Content-disposition", "attachment;filename=printing.pdf")
response.outputStream.flush()`
If i try with paragraphs inside cells instead of nested tables i get what i am expecting
I am probably missing something. Thanks for any help