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

210
Views
Fecha de salida de la tabla al archivo CSV

Tiene un problema para generar la fecha de la fila de la tabla. Básicamente, tengo una tabla con datos seleccionados de PHP. Intento enviar los datos de la tabla a Excel usando JavaScript (lo encontré a través del sitio web). Todos los datos en Excel se ven bien, excepto la fecha que genera "######".

Así que básicamente esta es mi tabla:
Así que básicamente esta es mi mesa.

Este es mi JavaScript

 <script> function exportData(){ /* Get the HTML data using Element by Id */ var table = document.getElementById("report"); /* Declaring array variable */ var rows =[]; //iterate through rows of table for(var i=0,row; row = table.rows[i];i++){ //rows would be accessed using the "row" variable assigned in the for loop //Get each cell value/column from the row column1 = row.cells[0].innerText; column2 = row.cells[1].innerText; column3 = row.cells[2].innerText; column4 = row.cells[3].innerText; column5 = row.cells[4].innerText; column6 = row.cells[5].innerText; column7 = row.cells[6].innerText; column8 = row.cells[7].innerText; /* add a new records in the array */ rows.push( [ column1, column2, column3, column4, column5, column6, column7, column8 ] ); } csvContent = "data:text/csv;charset=utf-8,"; /* add the column delimiter as comma(,) and each row splitted by new line character (\n) */ rows.forEach(function(rowArray){ row = rowArray.join(","); csvContent += row + "\r\n"; }); /* create a hidden <a> DOM node and set its download attribute */ var encodedUri = encodeURI(csvContent); var link = document.createElement("a"); link.setAttribute("href", encodedUri); link.setAttribute("download", "Report.csv"); document.body.appendChild(link); /* download the data file named "Stock_Price_Report.csv" */ link.click(); }

Aquí es cuando descargo el archivo de Excel, miro la fecha de salida:
Aquí es cuando descargo el archivo de Excel, miro la fecha de salida

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Tienes que extender el tamaño de la columna date

ejemplo

about 4 years ago · Juan Pablo Isaza Report
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!