Home:ALL Converter>Make sub columns (a group of columns with same header) in pdfmake

Make sub columns (a group of columns with same header) in pdfmake

Ask Time:2020-02-03T17:41:58         Author:gio

Json Formatter

I would print a table which has a group of columns with the same cell as header. An example in below:

enter image description here

I searched possible solution like this but it is a nested table, different of course from my purpose.

Author:gio,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/60036579/make-sub-columns-a-group-of-columns-with-same-header-in-pdfmake
shkaper :

Use rowSpan for cells extending n rows down, and colSpan extending n columns to the right.\n\nTry this:\n\nvar dd = {\n content: [\n {\n table: {\n headerRows: 2,\n body: [\n [{text: 'Item', rowSpan: 2}, {text: 'Properties', colSpan: 3}, '', '', {text: 'Status', rowSpan: 2}],\n ['', {text: 'A'}, {text: 'B'}, {text: 'C'}, ''],\n ['Thing', 'Prop A', 'Prop B', 'Prop C', 'Free'],\n ]\n }\n },\n ],\n};\n",
2020-02-10T17:40:50
yy