Pdfmake: table rowspan and colspan is confusion

Created on 20 Dec 2017  ·  2Comments  ·  Source: bpampuch/pdfmake

When I use the rowspan and colspan of the table attributes, the table's framework will be confusion,but my data framework is right , can author fix it? appreciate!!!

{
                    content: [
                        {
                            style: 'tableExample',
                            color: '#333',
                            table: {
                                headerRows: 1,
                                // keepWithHeaderRows: 1,
                                body: [
                                    [
                                        {text: '月份', rowSpan: 2},
                                        {text: '驾驶人总数', rowSpan: 2},
                                        {text: '违法次数', rowSpan: 2},
                                        {text: '违法率', rowSpan: 2},
                                        {text:'交通违法分类',colSpan:6},
                                        '',
                                        '',
                                        '',
                                        '',
                                        '',
                                        {text: '累计违法次数', rowSpan: 2},
                                        {text: '当月已处理数', rowSpan: 2},
                                        {text: '累计已处理数', rowSpan: 2},
                                        {text: '备注', rowSpan: 2},
                                    ],
                                    [
                                        {},
                                        {},
                                        {},
                                        {},
                                        {text:'闯信号灯'},
                                        {text:'闯信号灯'},
                                        {text:'闯信号灯'},
                                        {text:'闯信号灯'},
                                        {text:'闯信号灯'},
                                        {text:'闯信号灯'},
                                        {},
                                        {},
                                        {},
                                        {},
                                    ],
                                ]
                            }
                        },
                    ],
                    defaultStyle: {
                        font: 'Chinese',
                    },
                    styles: {
                        companyName: {
                            fontSize: 18,
                            bold: true,
                        },
                        tableName: {
                            marginTop: 10,
                        },
                        tableExample: {
                            marginTop: 10,
                        }
                    }
                }

image

Most helpful comment

You have wrong docDefinition, header is on 2 rows, but is defined as 1 row (headerRows: 1). Change to headerRows: 2.

All 2 comments

You have wrong docDefinition, header is on 2 rows, but is defined as 1 row (headerRows: 1). Change to headerRows: 2.

thank you very much

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dgrice picture dgrice  ·  3Comments

SummerSonnet picture SummerSonnet  ·  3Comments

kumarandena picture kumarandena  ·  3Comments

m-brudi picture m-brudi  ·  3Comments

MathLavallee picture MathLavallee  ·  3Comments