How to add table in WordPress post

May times we run into a situation where we feel presenting some inforation will be easy to understand if its presented in a tabular manner however, wordpress editor does not have any feature to add table in a post. You can add table in a post by two ways

  1. Using WordPress plugin TinyMCE Advanced
  2. Create a post using table html tags

Using WordPress plugin TinyMCE Advanced

If you are not comfortable with coding then this is the best method. Even if you are comfortable with coding html, this plugin is so user freindly that you will love to use it.

Go to Plugins->Add New and search using “TinyMCE Advanced”. You will find “TinyMCE Advanced” by “Andrew Ozz”. Simply install and activate it.

Your create post window will have many more options along with insert table.

TinyMCE Advanced

Create a post using table html tags

 

Use this option if you are confortable with coding and you dont want to clutter your WordPress installation with multiple plugins. If you are advance user of wordpress, you will have 10-20 plugins installed for various activities. Sometimes plugins interfere with each others functions and system might behave unexpectedly. To avoid this, you can simple use code

Here is sample code with one head and two rows

Important Note: You need to copy this code by going into “TEXT” mode of the WordPress editor, otherwise, this table will not render and you will see html on the post

<table>
<tbody>
<tr>
<td style="width: 218.609px;"><strong>Remark</strong></td>
<td style="width: 345.609px;"><strong>API URL</strong></td>
</tr>
<tr>
<td style="width: 218.609px;">This provides last 10 latest posts</td>
<td style="width: 345.609px;">https://www.techtrekking.com/wp-json/wp/v2/posts</td>
</tr>
<tr>
<td style="width: 218.609px;">This provides last 10 latest posts</td>
<td style="width: 345.609px;">https://www.techtrekking.com/wp-json/wp/v2/posts</td>
</tr>
</tbody>
</table>

and this will render as below

Remark API URL
This provides last 10 latest posts https://www.techtrekking.com/wp-json/wp/v2/posts
This provides last 10 latest posts https://www.techtrekking.com/wp-json/wp/v2/posts