I have tried this link for getting multiple headers
download() {
var columns = ["ID", "Country", "Rank", "Capital"];
var data = [
[1, "Denmark", 7.526, "Copenhagen"],
[2, "Switzerland", 7.509, "Bern"]
];
var pdfsize = 'a0';
var doc = new jsPDF('l', 'pt','a0');
doc.autoTable(columns, data, {
theme : 'grid',
styles: {
halign: 'right'
},
headerStyles: {
fillColor: [33, 150, 243],
halign:'center',
lineWidth: 1,
lineColor: [221, 221, 221]
},
columnStyles:{
0: {columnWidth: 266}
},
margin : {
top : 100
}
});
var columns2= ["ID","Rank", "Country","Rank", "ID", "Rank","ID", "Capital"];
doc.autoTable(columns2, data, {
theme : 'grid',
styles: {
halign: 'right'
},
headerStyles: {
halign:'center',
lineWidth: 1,
lineColor: [221, 221, 221]
},
margin : {
top : 120
},
columnStyles:{
0: {halign:'left'}
},
});
doc.save('table.pdf'); };
}
This is the code i have tried for the jspdf-autotable . I need multiple headers table like this.I need two headers how do i map those headers together can you please me with this. Am not able to map those headers like as shown in below image.