I’m making use of JSDF autotable but when i generate the PDf file then header is coming as top row but I want the header as the first column instead of top row, Please help
My code below:
const { jsPDF } = require(“jspdf”);
require(‘jspdf-autotable’);
var result = [
{
name: "Gautam Sharma",
age: 32,
country: "India",
},
{
name: "John Williamson Latham",
age: 31,
country: "New Zealand",
},
{
name: "Adam Nicholls",
age: 31,
country: "South Africa",
},
];
let info = []
result.forEach((element, index, array) => {
info.push([element.name, element.age, element.country])
});
var doc = new jsPDF();
doc.autoTable({
head: [["Name", "Age", "Country"]],
body: info
});
doc.save("table.pdf");
Expected PDF file I want header in first column:
Please help