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

169
Views
Cómo estilizar el archivo de Excel exportado usando el paquete xlsx en angular

Tengo un problema con el archivo de Excel exportado porque aparece con el mismo ancho en todas las columnas. Intenté muchas cosas. Algunos de ellos afectaron solo a la primera columna. ¿Cómo puedo especificar el tamaño de la columna o cómo puedo hacerlas crecer todas? ¿Alguien me ayuda a solucionar esto?

Aquí está mi parte del código =>

 exportExcel() { const element = document.getElementById('gridContainer'); const ws: XLSX.WorkSheet = XLSX.utils.table_to_sheet(element); ws['!cols'] = []; Object.keys(element).forEach((cell: any) => { const colWidth = cell==='Title' ? 150 : cell==='FirstName' ? 150 : cell==='LastName' ? 150 : cell==='Position' ? 150 : cell==='State' ? 170 :cell==='BirthDate' ? 130 : 50; ws['!cols'].push({ wpx: colWidth }); }); /* generate workbook and add the worksheet */ const wb: XLSX.WorkBook = XLSX.utils.book_new(); XLSX.utils.book_append_sheet(wb, ws, 'Datatable8'); /* save to file */ XLSX.writeFile(wb, 'Datatable8.xlsx', {cellStyles: true}); }
about 4 years ago · Santiago Trujillo
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!