Click to See Complete Forum and Search --> : Importing Excel sheet into html table


VTG
12-12-2005, 06:12 AM
Hi,
I have a spreadsheet of some 300 lines which I don't fancy manually typing into a html table if I can help it.
I want to move away from having the spreadsheet just displayed on the page if possible and would like to know if there's a way (or a helper application) I can export from the spreadsheet into a ready-done html table (i.e. a text file with html code) that I can then just paste into my webpage code.
I don't really want to get complicated with Javascript etc, it's not corporate, just a personal webpage and the data isn't sensitive. I don't want to sit and grind through code that's more advanced than general html if I can help it as I'm not much interested in much more than the shallow paddling pool of web page development.
Does anyone have any ideas, or would I be better off just formatting the spreadsheet to match my stylesheet and plonking it there on the page anyway, which I feel might be quicker and easier and allow me to concentrate on content?
As a further question, are there any server security issues with directly using an Excel worksheet in a web page?
Thanks.

Fang
12-12-2005, 06:34 AM
Export it as .csv file, then run a macro to convert to a table.

VTG
12-12-2005, 06:55 AM
Export it as .csv file, then run a macro to convert to a table.
Thanks for the reply, but how do I do that bit?

Fang
12-12-2005, 07:25 AM
I generally use PFE (http://www.lancs.ac.uk/people/steveb/cpaap/pfe/default.htm) which has a simple macro recorder.
Other ways of converting to table are JavaScript or a server-side language. The solution depends on how often and complex are the conversions.

TheBearMay
12-12-2005, 07:31 AM
Why not just use the built in function in Excel - Save As..Web Page - and then extract the table it creates?

Fang
12-12-2005, 07:39 AM
Why not just use the built in function in Excel - Save As..Web Page - and then extract the table it creates? Have you seen the xxxx it adds to the table! It makes Word look html compliant.

TheBearMay
12-12-2005, 07:52 AM
Didn't say it was pretty... :D

Charles
12-12-2005, 10:15 AM
In the past I've saved the data as "HTML", used Tidy to convert to XHTML and then apply an XSLT style sheet to generate real HTML and to my liking. But if I didn't already know XSLT and have the processors up and running locally - something that was more difficult than learning XSLT - I would save as CSV and then parse the file with Perl.

That said, I note that Excel 2003 will export directly to XML which allows for easy conversion with XSLT or anything that will parse XML.

Charles
12-12-2005, 10:17 AM
Didn't say it was pretty... :DStrictly speaking, the question was about HTML and not tag soup.