Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

312
Views
jsPDF Show line above and beneath table

Can you tell me how to add a blue line above and beneath the table with jsPDF like in the example here? I have problems with the documentation (https://github.com/simonbengtsson/jsPDF-AutoTable) and can't modify the header.

Link to desired outcome

//export table to pdf
function generatePDF() {
  var doc = new jsPDF('p', 'pt', 'a4');

  doc.setFontSize(14);
  doc.text("Title of Diagram and Table", 40, 45);
  
  var elem = document.getElementById('table_with_data');
  var data = doc.autoTableHtmlToJson(elem);
  doc.autoTable(data.columns, data.rows, {
    margin: {left: 35},
    margin: {top: 70},
    theme: 'plain',
    alternateRowStyles: { fillColor: [246, 246, 246] },
    tableWidth: 'auto',
    fontSize: 8,
    overflow: 'linebreak',
    }
  );
    
 
  doc.save('results.pdf');
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!