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

335
Views
jsPDF | dataKey de autoTable no funciona en angular

Mi PDF no cambia cuando uso columnStyles con la propiedad dataKey, pero mi código funciona correctamente cuando uso el número en lugar de dataKey.

Este es un código que funciona incorrectamente:

 head = [{title: 'توضیحات', dataKey: 'MoreDescribe'}, {title: 'امکانات', dataKey: 'properties'}, {title: 'مبلغ خرید', dataKey: 'id'}] body = [ [{content: ' قابل استفاده'}, {content: 'اندازه مناسب'}, {content: '10000 تومان'}], [{content: ' قابل استفاده'}, {content: 'اندازه مناسب'}, {content: '10000 تومان'}], [{content: ' قابل استفاده'}, {content: 'اندازه مناسب'}, {content: '10000 تومان'}] ] printAll(){ const doc = new jsPDF(); autoTable(doc, { head: [this.head], body: this.body, headStyles: { font: 'Shabnam',halign: 'center',valign: "middle"}, // work bodyStyles: { font: 'Shabnam', halign: 'center', valign: "middle" }, // work columnStyles: { id: { cellWidth: 5000 },properties:{cellWidth:700},MoreDescribe:{cellWidth:500} } // not work }) }

mi resultado es: ingrese la descripción de la imagen aquí

si cambio el

 columnStyles: { id: { cellWidth: 5000 },properties:{cellWidth:700},MoreDescribe:{cellWidth:500} }

a

 columnStyles: { 1: { cellWidth: 5000 },2:{cellWidth:700},3:{cellWidth:500} }

El estilo cellWidth se aplica a mi tabla. pero quiero usar dataKey. ¿Cómo puedo hacerlo?

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!