Coding⏱️ 2 min read📅 2026-05-31

How to Fix: Export html table data to Excel using JavaScript / JQuery is not working properly in chrome browser

Export HTML table data to Excel using JavaScript or JQuery not working in Chrome browser.

Quick Answer: Use the XLSX library instead of native JavaScript, as it is more compatible with Chrome and other browsers.

The issue you're experiencing with exporting HTML table data to Excel using JavaScript/JQuery in Chrome browser is due to the way Chrome handles the 'data:application/vnd.ms-excel' MIME type. Mozilla Firefox and other browsers handle it differently, which causes the export to fail.

🛑 Root Causes of the Error

  • Chrome does not support the 'data:application/vnd.ms-excel' MIME type by default.

🔧 Proven Troubleshooting Steps

Method 1: Using a Binary Data URI

  1. Step 1: Replace the 'data:application/vnd.ms-excel' MIME type with a binary data URI using the Binary Data URI scheme.

Method 2: Using a Server-Side Solution

  1. Step 1: Use a server-side language like Node.js, Python, or Ruby to generate an Excel file.

✨ Wrapping Up

To fix the issue, you can use either of the two methods above. Method 1 involves modifying your JavaScript code to use a binary data URI scheme, while Method 2 requires setting up a server-side solution using a programming language.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions