Question:
how to export a HTML table to an excel file (.xls)?
Colin
2012-12-27 03:36:16 UTC
the HTML table is in its own iframe
and is currently being hosted on yahoo's servers
the table is generated using PHP.
Four answers:
VBA
2012-12-27 09:51:10 UTC
You don't export the HTML table to an .XLS file; you export the data that created it to an .XLS file -- or another format that Excel can open.



If your HTML table is generated from a PHP script, then at some point you've got the data in a PHP array. Use similar code to generate instead of an HTML table, either CSV/XML (easier) or XLS (harder because it's a proprietary format).



http://stackoverflow.com/a/6493794

http://stackoverflow.com/a/5112417

http://www.zedwood.com/article/133/generate-xls-spreadsheet-files-with-php
Dave P
2012-12-27 03:57:32 UTC
This is how I do it, there may be another way but this works:



1) select and copy the text within the table to the clipboard

2) paste it into a plain text editor

3) save it to a file with a .csv extension (it must be saved as plain text, not .doc or rtf or anything other than plain text. the csv extension will let excel recognise it as structured data). Note - csv will not be an option in the save menu, simply overwrite .txt with .csv to create the file.

4) open excel and do file>open and navigate to your saved .csv file. Make sure the open dialogue box is set to recognise all files. Click to open the .csv file. It might ask you to review how it will separate the data but it should be obvious.



csv stands for "comma separated values". Although your data will not be comma-separated (it will be tabs or spaces) this extension will tell excel to look for structure in the text and separate it accordingly.



Once it's in excel, you can save it as a workbook or whatever extension you want and excel witll format it as needed.
NAMPEL
2014-12-19 11:24:52 UTC
the best trading software http://tradingsolution.info

i have attended a lot of seminars, read counless books on forex trading and it all cost me thousands of dollars. the worst thing was i blew up my first account. after that i opened another account and the same thing happened again. i started to wonder why i couldn,t make any money in forex trading. at first i thought i knew everything about trading. finally i found that the main problem i have was i did not have the right mental in trading. as we know that psychology has great impact on our trading result. apart from psychology issue, there is another problem that we have to address. they are money management, market analysis, and entry/exit rules. to me money management is important in trading. i opened another account and start to trade profitably after i learnt from my past mistake. i don't trade emotionally anymore.

if you are serious about trading you need to address your weakness and try to fix it. no forex guru can make you Professional trader unless you want to learn from your mistake.
jamason
2016-10-19 09:55:33 UTC
you additionally could make export document and in document you are able to save all information in between you will desire to positioned " ; " and document save like " .cvs ". i became ones make like this in javascript and then i became open this document in excel and it became artwork.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...