Using tables allows you to present data in a way that is easier to understand, especially when you are including data in articles on a WordPress website. In this article, we will discuss how to create a WordPress table so you can present data that is easier for your website visitors to understand.
There are 3 options you can use to present data using tables in WordPress, which are using the WordPress block editor (Gutenberg), using a plugin, or using HTML code.
You can choose which method you want to use to display a table in WordPress based on the method you find easiest.
1. Creating a WordPress Table with the Block Editor
If you use the default WordPress block editor or Gutenberg and do not want to add a plugin to create a table, you can still create one easily. Here is how
- Edit or create a new article using the WordPress Block Editor
- Once you are on the WordPress block editor page, click the plus icon in the top-left corner to search for the table block
- Search for and select the “Table” block to add a table to the editor
- Choose the number of columns (Column Count) and the number of rows (Row Count) that you want to add, for example, we will create a table with 2 columns and 5 rows (not including the header row), then click the Create Table
- button. Enter the content you want to add to the table
- At this point, we have created a table, but there is still no header for each column. You can enable the Header Section option in the panel on the left side of the screen to add a table header.
- If you want to change the appearance to a zebra model (one row white, the row below it black, and the one below that white), you can open the Stylesoption, then select the stripes
- style. Now you can publish the table you have created, or perform more customizations.
2. Creating a WordPress Table Using a Plugin
There are many WordPress plugins that allow you to create tables easily, for example TablePress, wpDataTables, Ninja Tables, WP Table Builder, and others.
Here we will use TablePress because it is the most frequently used plugin, it is easy to use, and it does not slow down the website too much.
After the TablePress plugin is active in WordPress, you can follow these steps
- From the WordPress dashboard, open the TablePress menu → Add New Table (or if you already have a table saved in XLSX, CSV, ODS, HTML, or JSON format, you can use the Import Table option)
- Provide a table name, description, number of columns, and number of rows you want to create, then click the Add Tablebutton. This configuration can still be changed later, so do not worry if the number of columns or rows you created is not quite right
- Input the data you want to add to the table. Unlike the table in the WordPress editor, by default, the first row of this table will be the header row. So if you want to create 5 rows of data and 1 header row, you need to create 6 table rows.
- To check the appearance of the table you created, you can use the Preview button to display a table preview
- If everything looks good, you can save the table, then copy the shortcode that can be used to display the table in an article
- Now you can add or edit a new article where the table will be added, then just paste the shortcode you previously copied and the table will be added automatically
3. Creating a Table with HTML Code
If you use the Classic Editor and do not want to use an additional plugin to display a table, you can use HTML code, because currently there is no option to add a table in the classic editor
- If you want to use HTML code, you can create the HTML code manually using a text editor, or you can also use online tools, for example divtable.com
- Choose the number of columns and rows you want to create on divtable.com, and options will appear for you to enter your table data
- After filling in the table, you can copy the HTML code located in the panel on the right side of your table view
- Now you can add or edit a WordPress article that uses the classic editor, then in the display options change from Visual to Text and paste the HTML code you copied
- Change the view back to Visual, and the table will be displayed automatically so you can publish your article or make other changes
Those are 3 easy methods for creating a WordPress table. You can use whichever method you find most comfortable, as all three methods can be used to present data that is easier to read using tables.
COMMENTS
Loading...