• Home
  • About

Snippet IT

IT News, Programming, Internet and Blogging

  • Programming and Scripting
  • Tips and Tricks
  • Software and Hardware
  • New and Happening
You are here: Home / Programming and Scripting / Wordpress: How To Add Table Into A Post

WordPress: How To Add Table Into A Post

November 26, 2009 by Sze Hau Leave a Comment

WordPress’ WYSIWYG post editor does not come with the functionality that allows user to create table when editing a post (like what you can do in Microsoft word).

However, putting a table into a post in WordPress editor is not as hard as writing a software codes. What you need to know is to familiar yourself with some HTML tags.

To create a table in post, you will need to switch your editor to HTML mode. Simply click on the HTML tab on the top-right of your WordPress editor and then insert the table codes into the position where you want the table appear.

Here is a simple table:

<table border="1" cellspacing="1" cellpadding="1" width="100">
<tbody>
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</tbody></table>

And it looks like this:

Column 1 Column 2
Data 1 Data 2

You can change the table width by changing the width parameter to a certain value, either in pixels (without unit) or percentage (with %). You can also change the border size (border), cell’s padding (cellpadding) and cell’s spacing (cellspacing). Border size, cell’s padding and cell’s spacing are in unit pixels.

After you have put the code, change back to visual mode to preview your table. At that time, you can apply format (e.g. color, bold, link and etc) to your text in the table.

Another table with 2 columns in a row are merged:

<table border="1" cellspacing="1" cellpadding="1" width="100">
<tbody>
<tr>
<td colspan="2">2 Columns merged</td>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</tbody></table>

And it looks like this:

2 Columns merged
Data 1 Data 2

Another table with 2 rows in a column are merged:

<table border="1" cellspacing="1" cellpadding="1" width="100">
<tbody>
<tr>
<td rowspan="2">Column 1</td>
<td>Column 2</td>
</tr>
<tr>
<td>Data 2</td>
</tr>
</tbody></table>

And it looks like this:

Column 1 Column 2
Data 2

It is easy and fun, right? You always have to trial and error to create the table you want. Once you have understood the basic, you can easily create tables with the design you want.

Have fun!;

Filed Under: Programming and Scripting, Tips and Tricks Tagged With: how to, HTML, Wordpress

About Sze Hau

Geek. Love programming. Coffee addicted. Married with two children. Working towards financial freedom.

Leave a ReplyCancel reply

Advertisement

Email News Letter

Sign up to receive updates daily and to hear what's going on with us

Software and Hardware

MD5 and SHA1 Checksum Using Windows

July 5, 2017 By Sze Hau Leave a Comment

Blog Network

  • Personal Fincance Personal Finance – Personal Money Tips, Stock Investment, Small Business and Make Money Online
  • szehau's weblog Life, Internet, Software, Gadgets, Programming and Investments

Snippet IT

This is the place where I want to share anything about information technology.

Search

Recent

  • MD5 and SHA1 Checksum Using Windows
  • MD5 and SHA1 Checksum Using Linux
  • Java: Unlimited Strength Jurisdiction Policy
  • WordPress: How To Change Admin Username
  • Linux: How To Compress And Decompress Folders And Files

Tags

advertisement blog C# Chrome DecimalFormat EGPC Float format format Integer free icons Gmail Google Google Adsense Google Chrome Google Search Engine Google search result how to HTTP Java JavaScript Linux money password performance PHP programming search engine optimization secure security short URL site value spam SQL static constructor String thread tiny URL Tips and Tricks trackback twitter video Wordpress wordpress plugin wordpress theme Youtube

Copyright © 2025 · Magazine Pro Theme on Genesis Framework · WordPress · Log in