PHP: turn an HTML table into an extension sheet?

I am creating an HTML table full of data. They need it to be an editable spreadsheet, although they can save and edit.

I currently have it exactly the way they want, but as an HTML table, is there any way I can convert this to an extended excel sheet that they can load?

Thanks!!

+5
source share
3 answers

Here, what I use has not failed me yet:

 header('Cache-Control: no-store, no-cache, must-revalidate');     // HTTP/1.1
 header('Cache-Control: pre-check=0, post-check=0, max-age=0');    // HTTP/1.1
 header ("Pragma: no-cache");
 header("Expires: 0");
 header('Content-Transfer-Encoding: none');
 header('Content-Type: application/vnd.ms-excel;');                 // This should work for IE & Opera
 header("Content-type: application/x-msexcel");                     // This should work for the rest
 header('Content-Disposition: attachment; filename="'.basename('yourFilenameHere.xls').'"');

'yourFilenameHere.xls' should obviously be changed :)

+6
source
+4

, , (CSV). .

0

All Articles