How to convert Excel tables to HTML tables

Office for Mere Mortals
Your beginners guide to the secrets of Microsoft Office
Invalid email address
Tips and help for Word, Excel, PowerPoint and Outlook from Microsoft Office experts.  Give it a try. You can unsubscribe at any time.  Office for Mere Mortals has been running for over 20 years, we've never, ever revealed or sold subscriber details.  Privacy policy

It’s easy to make an Excel list into an HTML table.

Excel has great list making features. It’s often the best way to manage a simple list or database. There’s features for sorting, filtering, auto-complete and calculated fields.

But using the finished list isn’t always obvious, especially if you want to use an Excel list in a web page or application. ASP.net has features to use an Excel file as a data source but they are slow and clumsy.

It’s better to use Excel to make the list then convert it into a form that’s useable elsewhere.

And that can be as simple as copy & paste!

All you need to do is select the cells in Excel, choose Copy. Then paste into a web page editor, the contents (not formulas) will be converted into a

HTML code with cells.Here’s a short Excel table, copied into MS Expression Web. You can see both the raw HTML and the displayed table.


Then you can edit the web table as you like. Probably the first thing you’ll want to do is remove the Office HTML formatting that is also copied like
which you probably don’t need and makes the HTML harder to read. There’s also Microsoft Office’s favorite pointless piece of HTML: for a simple single space. Hopefully your HTML editor has a feature to remove this extra formatting.

Microsoft’s own Expression Web has one under Tools | Optimize HTML and so do most HTML editors these days.

The height and width settings provided by Excel might not suit your needs on a web page.

Tableizer

Tableizer is a nice little online tool for converting Excel tables into HTML. Simply copy your Excel table into Tableizer and click the Tableize it! button.

The nice thing about Tableizer is that the formatting is done with styles leaving the table data as ‘clean’ as possible. It’s simple to copy the Tablized code then change or remove the table formatting.

As with all online tools, it might not work with large amounts of data and you might not want to use it with any confidential data.

Publish as Web Page

Excel’s Publish as Web page option (usually accessed via Save As … Web Page ) can generate HTML similar to code from the copy & paste method.

You can publish the entire worksheet or just a selection. There is also an option to AutoRepublish ie refresh the HTML page each time you save the worksheet. This is useful regularly changing lists.Other options

There are all manner of ‘Save As’ options from Excel that could be then ‘massaged’ into a web table. For example, Save to XML then using a XSLT transform or save to a delimited text file and work from there.

See Also

Latest news & secrets of Microsoft Office

Microsoft Office experts give you tips and help for Word, Excel, PowerPoint and Outlook.

Give it a try. You can unsubscribe at any time.  Office Watch has been running for over 20 years, we've never, ever revealed or sold subscriber details.  Privacy policy
Invalid email address