I just realized it’s a bit tricky when it comes to including tables in wordpress posts or pages. If you are not a technical personal and if you do not have experience handling html then you might find yourself fumbling when you have have to insert a table in a wordpress post or page.
This code will help you insert tables into wordpress posts and pages easily :
<table style=”text-align: center; height: 152px;” border=”1″ cellspacing=”0″ cellpadding=”0″ width=”390″>
<tr style=”background-color: #e9e9e9; font-weight:bolder;”><td>Month</td>
1> Copy the code,
2> Go to your wordpress editor (post or page),
3> If you have visual editor enabled then you’ll have have two options ‘Visual / HTML’, select HTML
4> Paste the above copied code
and when you switch to “Visual” mode, you’ll have a table which will look like
You can change the height and width of the table by clicking on the ‘small box’ at the corner of the table and dragging them to a dimension of your choice.
represents a row with four columns. by adding an extra <td>content</td> you’ll be adding an extra column data element. And by copy pasting the entire block, you’ll add an extra row to the existing table.
Some know issues are, at times you won’t be able to type anything before or immediately after the table in the visual mode. In such case, go to HTML mode and type before <table> or after</table> respectively.
Alternatively, you can use the wp-table plugin. But I feel this one’s much easier than the wp-table plugin when I want something done quick !
If you want to create some fancy looking tables then you can follow this tutorial
Feel free to ask me doubts if you have any, and I’ll clear all of them for you !
Olma Madrid says
EXCELLENT RESOURCE, Kate! Thank you for sharing!
sunil chhabra says
thanks for the post…it help me to add table in my post…keep the good works going…:-)
Carlos Del Valle says
It worked really fine here, thanks for that
John F Taylor says
Great code easy to follow! THANK YOU!
How insert loop post in table?
I have create custom page (ex: custom_page1.php) in my theme. I want echo post by category in table? How?
@Heidi – Which version of wordpress are you using ?
This technique doesn’t work on the latest WordPress updates. =/
Thanks for the HTML, it inserted the table for me, but not exactly how i wanted it.
Wordpress doesn’t have a proper formatting for the tables. I think I need to configure .TR and .TD in my CSS to get a well formatted output.
The current HTML just inserts the Table, I cannot modify the Width of rows and columns.
Hey, thanks a bunch for the share, appreciate it!
Thanks for the code 🙂
Nice and simple, after fiddling around with table plugins I found it is so much simpler and easier to customize this code for what I need and its 2 years since you posted this!
Cheers mate, works a treat!
@Paul – Can you take an image of what the problem looks like, upload it to ww.picpaste.com and leave the URL in the image so that I can look into it and see if it’s a generic problem ..
every time I paste tables in when I publish it the tables have big pink highlights when you mouse over the table. Can anybody help me clear this up?
Thank you very much for this. It really helped my work.
@Cathy – Yes you can, a bit of customizing is required, where you pull only one page, and display all categories in that page. The whole process has to be executed manually.
cathy threadgill says
I have 50 wordpress categories that I would like to set up on a wordpress page in a table format. Can I use this coding and where you have “Argentina” and “Movistar” enter the coding to link the wordpress categories?
suzanne welch says
Awesome….easy, next time will be easier. Come on by and take a look!
Thank you so much!
thanks Gautam for the code. Just created my latest post by using it.
Veronica Vynne says
Thank you, Worked great for me just need to learn how to centre it.
mahn even em tryin somethin similar and if this works ill b very very thankful just trying!! em messing wid the plugins from 4 days 😐
Temecula Handyman says
Great post. I used this on my blog and it worked great. I know tables are on the way out but there are times when nothing else will do. THANKS
Thank You Very Much! I appreciate that nudge towards the fckeditor. That has to be the best addition to WordPress ever. It has everything and does everything beautifully that you could ever want or need in a WYSIWYG Editor.
The only thing disappointing about it is not finding it sooner than I did.
Thanks again for supplying that info.
@fever18: I doubt it…
i am looking forward for some plugin to do this..
is there any plugin which can help me to insert the table in wp posts?
Ian Constable says
Thanks for this worked a treat
Tahir Yasin says
You can also use FCK Editor to Visually insert Tables into your post, no need to bother about any code.
You can download it from
dan mckinney says
Well, I had to resort to building a table with extra columns and I fill the right columns with a trusty spacer (blank) graphic to force the table graphics to position on the left side of the column. WP still tries to spread the table out to fill the column but is tricked by this process into presenting my info on the left of the column where I want it.
Admittedly, extra work but it gets the job done!
A table constructed in this manner is displaying the two journal cover graphics at the bottom of this page:
@Mike – Please refer to this link for guidance. It is self explanatory. Create tables as per your requirement and then paste the same in html of your wordpress blog.
Let me know if it works.
What am I doing wrong? I can’t get the text on the left to be up at the top.http://s102783.gridserver.com/?page_id=50
dan mckinney says
Say I have a table with 3 columns that contain only 3 letters XXX. The table will always spread out to fill the available space in the column. I can’t make a table that is only , say, 30 pixels wide. The table will always expand regardless of the width specified in the code. I am using WP 3.0 and MistyLook 3.8RC
Take a look at this page. the table holding the books is 3 columns. Notice how it will all equally space out.
If you mention the size of the table, I do not see how the table spreads out. Can you explain the scenario with more details, I’m curious to know whats happening.
dan mckinney says
Does anyone know if it is possible to “collapse” the table so that it does not expand to fill out the column in WP equally. ie the table width always expands to fill out the available space so items in the table are spread out and I would like for them to be closer together.
In the above example, I get no effect by reducing the size of the table with the handles.
@Amit – I agree, may be in the next release of WP, we might find tables by default…
This did the trick, thank you!
However, they should really include an easy tables editor without first copying the HTML code (like Google-Sites) does.
@Kate – that’s good link which will help wordpress users. Thanks for that.
Kate Murphy says
Everytime I made a change in a table design in WordPress, I had to hop all over the place trying to find my place in the HTML again and preview what I had done and then struggle to find where I left off.
A real hassle!
Using the Try It Yourself page at W3Schools.Com HTML made it easy to get the HTML right and then copy it into WordPress HTML tab.
And, yes, tables are critical for WordPress bloggers and writers. I write technical stuff and need them.
@Mr.Goose – I totally agree with your point. May be the developers at WordPress think that we bloggers never use tables, which is so wrong ! There were a few plugins which I tried, but heck most were not user friendly as I expected them to be. May be some developer who has time in hand can look into this issue.
Develop a plugin for inserting tables into wordpress will be a cool thing to work on sure. Anybody ?
Good article and clearly explained. But it confirms what I already feared. You have to do tables the hard way, in HTML. Whilst that is fine for me, it is horrible for non techy users! Hardly “grandma-friendly” is it?
Seems astonishing that WordPress does not do WYSIWYG tables when pretty much every other CMS does, e.g, Joomla, Moodle etc. Seems to me the WP devs have concentrated too much on silly widgets and have ignored the basic tasks that users actually need to do, don’t you think?
thank you! I was messing around with plugins to try and add multiple images uniformly but none seem to do it cleanly. This does what I need perfectly.
Gautam H N says
@Andi – I felt the wp-insert table was a little extra complicated for such a simple task. If any one has a bit of HTML knowledge, this is easy as breeze, otherwise also 🙂
Thanks for this beautiful code. It works perfectly to me. Yeah I agree with this one pretty easy than using the wp-plugin. Thanks again.