Nested / auxiliary tables with PDFMake

How to use nested / helper tables with PDFmake? I tried just putting a few tables, but this does not automatically repeat the title of the top level table for page breaks.

0
source share
1 answer

This code is a simplified example of using a subtable. It is adapted from the table section on the pdfmake playground (searching with Google search is not easy).

Paste the following: http://pdfmake.org/playground.html

// playground requires you to assign document definition to a variable called dd var dd = { content: [ { text: 'A simple table with nested elements', style: 'subheader' }, 'It is of course possible to nest any other type of nodes available in pdfmake inside table cells', { style: 'tableExample', table: { headerRows: 1, body: [ ['Column 1', 'Column 2'], [ { stack: [ 'Let\ try an unordered list', { ul: [ 'item 1', 'item 2' ] } ] }, [ 'or a nested table', { table: { body: [ [ 'Col1', 'Col2', 'Col3'], [ '1', '2', '3'], [ '1', '2', '3'] ] }, } ] ] ] } }, ] } 
0
source

Source: https://habr.com/ru/post/1236111/


All Articles