0
如何在PDFmake中使用嵌套/子表格?我試着簡單地放入多個表格,但不會自動重複頂層表格的分頁頭。PDF格式的嵌套/子表格製作
如何在PDFmake中使用嵌套/子表格?我試着簡單地放入多個表格,但不會自動重複頂層表格的分頁頭。PDF格式的嵌套/子表格製作
此代碼是使用子表的簡化示例。它從pdfmake遊樂場的表格部分改編而成(不容易通過谷歌搜索找到)。
以下內容粘貼到: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\'s try an unordered list',
{
ul: [
'item 1',
'item 2'
]
}
]
},
[
'or a nested table',
{
table: {
body: [
[ 'Col1', 'Col2', 'Col3'],
[ '1', '2', '3'],
[ '1', '2', '3']
]
},
}
]
]
]
}
},
]
}