How To Turn Your Excel Worksheet Into A Simple HTML Table

As I said in my NFL Playoff post, here is a brief description on how to convert an Excel worksheet into a simple HTML table.

What makes this tricky is that Excel tries to preserve all of the formatting from Excel in the HTML file, which adds an enormous amount of clutter that you do not need.

Here is what to do:

The Really Short Version

Save the worksheet as a “Single File Web Page”. Open it up in a text editor and erase everything above the <table> tag and below the </table> tag. Erase all of the attributes in the remaining tags.

The Longer And More Detailed Version

  1. Go to File, Click Save As.
  2. In the “Save as Type” drop box, choose the format “Single File Web Page (*.mht,*mhtml)”.
  3. Click Save.
  4. Click “Yes” in the pop up box to lose formating.
  5. Find the file where you saved it.
  6. Open it in a text editor like Notepad, though I highly recommend getting the free Notepad++
  7. Man there is a lot of code. Don’t worry. Just Search for the string “<table”. This is where the actual data from the worksheet is. It should contain a lot of <tr> and <td> tags. You should be able to spot your actual data inside the <td> and </td> tags.
  8. Erase all of the code before “<table”.
  9. Search for “</table”.
  10. Erase all of the code after “</table … > full tag.
  11. Erase all of the attributes inside all of the remaining tags such as “width=” and “style=”. A good short cut at this point is to a find and replace for what you are trying to erase and replace it with nothing since it is repeated in many of the tags.

That should do it.

Related books picked – and if possible read – by me. Sponsored by Amazon Associates.

Raw HTML Plugin – What to Use When You Want to Write HTML and Shortcode Examples in Your WordPress Post

In my last post, I used a lot of code examples in HTML, WordPress’ Shortcode, and the WordPress Video Plugin’s codes. If you have ever tried this before, you quickly realize that WordPress will immediately process the code as actual code that you want to implement, making the text that are your examples disappear, and actually implementing them. This is extremely frustrating.

For example, I just wanted to post the general format for the code to embed a youtube video useing the WordPress Video Plugin:

&#91;youtube id&#93;

Instead, I got this:

As you can see, WordPress immediately implemented the code.

How do you stop this?

Install the Raw HTML Plugin.

After you install the Raw HTML Plugin, if you want to have the code not get implemented, enclose that code in raw tags:

[raw] your code [/raw]

Now, there are at least two catches to this.

Catch Number 1: You cannot type brackets(such as [] or <>) inside the raw tags. Instead, you need to use HTML Entities (sometimes referred to as special characters – you can find a good list here).

To actually make the code above appear on the screen and not get implemented, for:

&#91;youtube id&#93;

I actually typed:

&amp;#91;youtube id&amp;#93;

Catch Number 2: Do not use the “Visual” tab when editing your post. If you do, all of the entities that you carefully typed will disappear.

Raw HTML will not take care of everything for you, but it does make things much easier.

WordPress Video Plugin – the Solution to When YouTube Will Not Embed in WordPress

In my last post, I embedded a youtube video. It proved to be surprisingly tricky.  I ended up having to use the WordPress Video Plugin.

One is usually supposed to use the html iframe tag to do this:

<iframe width="560" height="315" src="http://www.youtube.com/embed/-iFeC7R3Tfg" frameborder="0" allowfullscreen></iframe>

or a WordPress shortcode like this:

[youtube=http://www.youtube.com/embed/-iFeC7R3Tfg&w=560&h=315]

It turns out, neither of these worked. Instead, I used the WordPress Video Plugin. This is easy to do. If you know how to administrate WordPress, click on “Plugins->Add New”. Then search for “WordPress Video Plugin”. When you find it, click on “Install Now”. After it installs, click “Activate”.

After you have finished installing and activating it, in order to embed a youtube video, use the following format:

[youtube id]

where id is the identification youtube uses to uniquely identify the video.  If you look at the failed attempts above, it would be the part in bold.

[youtube=http://www.youtube.com/embed/-iFeC7R3Tfg&w=560&h=315]

Causing the use of the WordPress Video Plugin to embed the video from the last post to look like this:

[youtube -iFeC7R3Tfg]

You can find details about how to embed other videos using the WordPress Video Plugin here.