Bluehost

How to Insert a Table Into a WordPress Blog Post

March 19, 2008 Posted under: Blogging by Caroline Middlebrook

The default WordPress editor does not allow much HTML and it does not allow tables to be inserted. In this post I’ll show you a neat plugin that allows you to insert tables into your WordPress posts and exactly how to use it.

tables in wordpress blog posts

I was actually first asked about this a little while ago by Trevor Mulligan. At the time I had not needed to insert a table into any of my blog posts so I was unable to help him. A few days ago I published a list of over 100 CSS Galleries which are great for getting backlinks and traffic and I wanted to format the information in a table so I needed to figure out how to do it.

The wp-table Plugin

One of the reasons I love WordPress so much is that its functionality is infinitely expanded by the wide range of plugins available for it. One such plugin is wp-table by Alex Rabe. The instructions on that page work but I found it somewhat non-intuitive to use so I thought I’d do my own little write-up.

Setting up the Tables

Now here’s the weird thing - the plugin provides a table editor but that editor is separate from your blog posts. You create tables for your blog as a whole, each table gets its own ID and then to put a table into a blog post you insert a special tag. I would have expected the table editor to be built into the post editor but it isn’t which is why it’s a little confusing.

Once you’ve uploaded and activated the plugin you get a new option under the manage tab. You can see it below:

wordpress tables manager

That screenshot also shows the one and only table I have at the moment which is the CSS Galleries one. There are two ways to create a table. You can manually add one by specifying the name and the number of rows and columns but that is restrictive as the drop-down only allows 20 rows.

Thankfully there is a second option to import a table from a file. You simply browse from a file on your computer and select a delimiter character to use. Here is a picture of that in action:

import wordpress table data

What I did for my post was to write the information out in Microsoft Excel (Open Office has the same functionality) and then export that as a CSV file. CSV is a Comma Separated file which means that each row in the spreadsheet is exported as one line of text with a comma character separating each column.

Inserting a Table Into a Post

Now once you’ve setup your table, inserting into a blog post (or page) is very simple. Make a note of the ID of the table which is 5 in the example above and then you use the following bracket notation to insert it:

wordpress table bracket notation

Simple really.

Embedding Links in the Text

I hit a snag right away - a CSV file is plain text and I wanted to link to each one of the directories or the post wouldn’t have been nearly as useful. In Excel I was able to automatically turn the url’s into links but as soon as I exported them as a CSV they got stripped back to plain text.

However, the plain text can contain HTML so I changed the text of the link to the HTML required to display as a link using the HREF tag. I knocked up a quick program to do this for me so I didn’t have to do it manually for 100 lines of text!

Basically, if you want links in your table you have to ensure that the source text contains the full HTML to use.

If you've enjoyed reading this post then please subscribe to my Full Text RSS Feed.


Stumble it!

You might also like these similar posts:

Articles
Email Course Update - Content Development Underway, Website Coming Soon
Butterfly Reports - A New Money Maker For Content Publishers & Product Owners by Mike Filsaime
Easter Egg Hunt! Find the Eggs & Win My StumbleUpon Traffic Course
Blog Validation: Do You Validate Your (WordPress) Blog?

24 Comments:

DeFries
March 19, 2008

This is a neat way of doing it, but my personal favorite is to use Windows Live Writer with which you can add tables like you would in Excel. Real Easy….

DeFries’s last blog post..Premium Themes kick-off met Mimbo Magazine

Andrea_R
March 19, 2008

There’s other ways too, like usign the Code tab in the Wirte window instead of the visual editor.
Or adding more buttons to the visual editor (or RTE) with plugins. (I know they’re out there.)
That way you don’t even leave the write window.

Andrea_R’s last blog post..It’s coming…

Hi Caroline,

Great tip.

Tables are a great way to increase readability and draw attention. Once more I pat myself on the back for choosing WordPress, as it has as many plugins as there are ideas in peoples’ minds.

Cheers,
Alex

Tom Beaton
March 19, 2008

Now that does look very useful. Wordpress constantly surprises me. It is pretty much impossible to keep on top of all the features available to wordpress.

Tom Beaton’s last blog post..Apologies and Contingency planning

Eklavya
March 20, 2008

Thanks for this great post Caroline. I could not full understand how did you embed links in the tables using a quick program. Can you elaborate a bit on that? It will be a great help.

Eklavya’s last blog post..An update on full RSS feed and a video tutorial

Charlie
March 20, 2008

Cool tip Caroline, I’m getting a little crazy adding widgets here and there but there are so many that are useful.

Homebizseo.com
March 20, 2008

Very infomative use of wrdpress plugins.

Massimo
March 20, 2008

Great technical hint here Caroline. Out of the millions of plugins out there it’s great finding somebody that pulls out and spends time explaining the good and useful ones.

Caroline Middlebrook
March 20, 2008

@DeFries, I’ve heard of Windows Live Writer, I might have to check that out!

@Eklavya, I am a programmer and I wrote some software to do some text manipulation for me. Thats about as far as I want to elaborate as it would be totally off-topic for this blog.

Bob Younce
March 20, 2008

Cool tool, Caroline. Thankya!

I know just enough html to be dangerous, so this is a good thing for me. Seriously, any time I’ve needed a table I wind up having to cut and paste from a wysiwyg into the code tab in Wordpress. This is very cool.

Bob Younce’s last blog post..Banging My Gong - The Voice

Scott
March 20, 2008

It has been a while since I have read a post that gave some good practical tips, thanks. Scott

DeFries
March 20, 2008

@ Caroline: Yeah, you should check it out. I have been using it now for almost a year and it is the perfect tool to maintain a lot of blogs for one, but it’s so much easier to just add content with WLW.

Cheers!

DeFries’s last blog post..Premium Theme: Structure van Justin Tadlock

Caroline one of my readers just asked me about this plug in and I played with it a bit, Ill send him your way, I hit the same snag with Excel and gave up, lol Plug ins dont like me

Making Sales Making Money’s last blog post..Monika Mundell Joins the Team and More

Caroline, first let me say I am a huge fan and appreciate all you do and secondly you are one of my online heroes, watching what you have been able to do in the short time you have been blogging… I’m jealous but happy for you.

Finally, about the post. Thanks for the info about the plugin I will install it right away but unfortunately I needed it a couple of days ago when I posted to my blog and needed a table. In my case, necessity was the mother of invention. I couldn’t figure out how to get it in there and look right so I ended up taking a screenshot of my table that I had created in Word and inserted it as a picture.

Maybe a good tip for someone that might have trouble with the plugin or hardly ever need one. Thanks again. Kirk

Kirk “Bassett Hound” Hanna’s last blog post..Bassett Hounds For Sale: How Much is Red Ribbon?

Mademind
March 24, 2008

Thx, that is great plugin and works fine.

Mademind’s last blog post..Top 30 Young Bloggers Under 21

Allen
April 1, 2008

I just went to download this plugin and saw that it’s not supported on WordPress 2.5 and a newer version isn’t planned. That’s a shame as it looked like a useful plugin.

Allen’s last blog post..Four worm experiment

matt
April 14, 2008

this plugin is not work with wordpress 2.5,

Caroline Middlebrook
April 14, 2008

@Matt, yes that’s right. In Wp 2.5, this post is obsolete as you can now insert tables into the code and it wont mess it up for you.

Andrew
June 2, 2008

Can you elaborate on how to do tables in WP2.5.1 as easily as this plug-in let me do it before I upgraded?

~Andrew~

Andrews last blog post..Power Picnic on the Millennium Meadow

@Andrew, I’ve not tried it in the latest version and I don’t think this plugin is needed anymore as I believe table support is now built in.

Vladimir
June 8, 2008

Thanks Caroline, I am glad that you share your knowledge with others. I didn’t know how to insert table to wp-post or page so I device some shortcut - google docs/table/insert table Write or insert what you want to create. Go to edit/html/copy then go to wp/write post/HTML/paste. I know that my process was slow compare to yours now. Anyway. Thanks. Vladimir

zam
July 1, 2008

I’m looking for this topic for the whole day. I found same source that probably not compatible with wordpress 2.5. Hope you can give another source that compatible with wp 2.5

Rajesh
July 13, 2008

Hi Caroline,
It was a nice post. I use blogger. Do you have any idea on how to embed a table in blogpost using blogger.com ?

Rajeshs last blog post..IPO’s make a dent in Investor’s Coffers

@Rajeh, no idea, I don’t even know if it is possible but I don’t use blogger so I am not the person to ask.


3 Trackbacks:

This Weeks Great Reads | Bare Fly.com

[...] How to Insert a Table Into a WordPress Blog Post [...]

Are Desktop Blogging Clients Worthwhile? | Richard Farrar's Blog

[...] a bit of a mission in WordPress without having to resort to hacking in HTML or installing a custom plugin for tables. I’ve always found this to be a serious omission with the WordPress [...]

Metal Shaper Man’s Blog

[...] 3 spaces Result: Failure…. Need to do some research here: I found this very interesting sight here: Oh boy….. Do I have a long way to go.. Alrighty I followed this link to the guy who wrote a [...]

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Recommended Services
MyBlogLog Community
Top Commentators
Copyright © Caroline MiddlebrookTheme designed by Design Farmer