' ) .then((response) => response.text()) .then((csvData) => { // Parse the CSV data const rows = csvData.split('\n'); const headers = rows[0].split(','); const data = rows .slice(1) .map((row) => row.split(',')); // Display the first 10 rows of data displayData(headers, data.slice(0, 10)); }); // Function to display data in a table function displayData(headers, data) { const table = document.getElementById( 'csv-table' ); // Create table header const headerRow = document.createElement( 'tr' ); headers.forEach((header) => { const th = document.createElement('th'); th.textContent = header; headerRow.appendChild(th); }); table.appendChild(headerRow); // Create table rows data.forEach((rowData) => { const row = document.createElement( 'tr' ); rowData.forEach((cellData) => { const cell = document.createElement( 'td' ); cell.textContent = cellData; row.appendChild(cell); }); table.appendChild(row); }); }
This is a simple webpage created using HTML and CSS.
Thank you for contacting us .
Please email back to us at "bhavana.girni@gmail.com".