Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Web
Expertise: Beginner
Aug 15, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Export HTML Table to Excel

Here is a simple way to export an HTML table to Excel with a single line of code. For the technique to work, you must have Excel installed on the your machine.

Copy the following code and paste it in notepad. Save it as an ASP page, and then open it in the browser to see the action live.

<% The main feature of this technique is that %>
<% you have to change Content type to ms-excel.%>

Response.ContentType = "application/vnd.ms-excel"

Don't include normal HTML, TITLE, HEAD, and BODY tags. They will create a problem.
Jitendra Kumar
Thanks for your registration, follow us on our social networks to keep up-to-date