Forum Moderators: phranque

Message Too Old, No Replies

XLS to HTML

         

kpnuts

9:50 pm on Aug 5, 2009 (gmt 0)

10+ Year Member



Hi there, Great to see such a brilliant and so wide a topical choice website on websites. TY :)

I'm not totally new to websites but my range isnt as wide as others, so it might be a basic question I'm asking but here goes......

I haven't done much with XLS so its a grey area for me.

I have seen the 'export to HTML' choice in the file menu, but this is very nasty.

I was wondering if there was a better option to export simple spreadsheets to HTML, that can have a CSS attached to them, so it controls the look?

I want to just keep the info highlighted with the parts I want to a simple page, so I then can import it into an iFrames page.

I have the pages already created with a hand made table, but this needs to be able to be done simply so other peopple can do it.

Is there anything you are aware of?

Thank you

Keith

bill

6:52 am on Aug 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld kpnuts.

That's not very easy actually. The formatting added to Office files is generally included inline and is not generated with W3C standards or clean code in mind.

If it's a simple table I've had success saving the Excel file as CSV or TSV and then opening it in a text editor. Search for the comma or tab (^t) and then replace each with

</td><td>
. Next, search for the end of the line (^p) and replace each with
</td></tr>^p<tr><td>
. You clean up any extra
<tr><td>
pairs and add the
<table>
tag at the top and
</table>
to the bottom. That should work generally, but you may need to clean up some blank lines and extra tags.

The problem with this method is that you lose any formatting. You would need to create that manually, preferably in CSS.