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!;
Leave a Reply