If you write something for a webpage, chances are that you write the text in HTML code. If you’re used to it, it often turns out to be easier than writing the text in a What-you-see-is-what-you-get-editor (WYSIWYG). In my experience, the WYSIWYG-editors never really work the way you want, so the HTML editor turns out to be better after all.
But what if you want to use a table that you have created in Excel? How can you transform an Excel table into a piece of HTML code that looks like this?
|row 1, cell 1||row 1, cell 2|
|row 2, cell 1||row 2, cell 2|
If you search for “HTML table from Excel” or “Excel to HTML table”, most sites will recommend that you save your Excel spreadsheet as Web Page. That will convert it into an HTML document that you can edit in your HTML editor. Another way is to use some software for the purpose.
This third way is easier: Use the CONCATENATE function or the “&” operator to create the HTML table right there in Excel, next to the table.
Here’s how to do it: As we saw above, a simple HTML table is made with certain tags. The trick is to add these tags next to our Excel table (column C, D, E and F).
Now, to create an HTML table row, we’ll concatenate the different items in the right order. You can either use the “&” operator or the CONCATENATE function:
Copy the formula down. Copy the HTML column and paste it into your HTML editor:
This is what it might look like in your HTML editor:
…and this is what it might look like on a web page (depending on the CSS code/stylesheet):
Other easy tricks:
- How to use Excel to Count Characters in a Text String
- How to Summarize Hours in Excel and Show the Right Result
- Create a drop-down list in Excel in 3 minutes!
Are you using a non-English version of Excel? Click here for translations of the 100 most common functions.