How To Insert Tables Into WordPress Posts / Pages

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″>

<tbody>

<tr style=”background-color: #e9e9e9; font-weight:bolder;”><td>Month</td>
<td>Mobile Networks</td>
<td>Month</td>
<td>Mobile Networks</td>
</tr>

<tr>
<td>Argentina</td>
<td>Movistar</td>
<td>Argentina</td>
<td>Movistar</td>
</tr>

<tr>
<td>Argentina</td>
<td>Movistar</td>
<td>Argentina</td>
<td>Movistar</td>
</tr>

</tbody>

</table>

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

How To Insert Tables Into WordPress Posts / Pages

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.

<tr>
<td>Argentina</td>
<td>Movistar</td>
<td>Argentina</td>
<td>Movistar</td>
</tr>

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 !

Be Sociable, Share!

44 comments

Leave a Reply

Your email address will not be published. Required fields are marked *