I've created a html table and I want its cells to be exported neither in excel or notepad.

I use this script to export the table but howcome the html form was also included in the export?

		
$filename ="excelreport.xls";
header('Content-type: application/ms-excel');
header('Content-Disposition: attachment; filename='.$filename);

Also I noticed that when I export it to text the html codes are also included

    I don't think PHP has the ability to convert HTML to Excel, which seems to be what you're doing.

    Your best bet is to use loops to iterate through the values you're outputting to make your HTML table but instead make them form a .CSV file.

      I haven't used it, but there's an Excel spreadsheet package in PEAR.

      As TheoGB says, you don't want to turn your data into an HTML table and then turn that into a spreadsheet. You want to turn the data into a spreadsheet directly.

        Write a Reply...