WP Table Manager is a useful tool that allows you to create and display tables for your users. We’ve already seen how the WordPress plugin can be used to create tables manually, or import and sync them with Excel files. The new update allows you to do even more: create tables from your MySQL database, which stores data about your WordPress website.
There are many reasons why you’d want to connect your database to WP Table Manager, and it is not isolated to just website developers either! For example, you might want to compile a quick, organized table with all your users, or a table of recent posts. The possibilities are endless, and WP Table Manager has got you covered!
Setting up tables from your WordPress database is very simple. To get started, head to WP Table Manager, click on Create New from the top left and then choose Database Table. WP Table Manager will take you to the Table Creation Wizard: a one-pager full of possibilities.
The Table Creation Wizard is separated into sections. You might want to think about each section and process sequentially to avoid having to go back-and-forth. In the Table Creation Wizard, you will go through the process of choosing tables, choosing columns, setting column titles, and adding other MySQL-like conditions.
The first step is choosing which database tables you want to use to create tables. It's all very simple: the first section shows you all tables in your WordPress database. You can select multiple tables by clicking on them, and if there are too many to browse, use the search functionality. Click on Next, select columns to proceed.
The second step is to choose which columns to use when creating your new tables. Once again, you can choose multiple columns and search. Press on Next, column titles to rename your columns; since most column names are not friendly, you can choose a simpler display name for each one.
The next part is where WP Table Manager shines. If you're a SQL programmer, you will find that WP Table Manager gives you all the functionality of SQL when creating database tables. And if you are not a SQL programmer, you will find it's very simple to get started.
The first SQL-like setting lets you define relations between tables, or foreign keys in SQL. In our example, we are displaying information from the post and postmeta tables. Each post has an ID, and each post ID has metadata associated with it. The relations settings let you specify these relations, as shown in the next figure.
The next settings are also very similar to MySQL. The first one is analogous to SQL's where, or filtering. This functionality lets you add display conditions, such as only showing information about certain posts. The box on the right lets you group the table's data by the value of certain columns. In both cases, you can introduce new rules by clicking on Add.
The final three settings are more concerned with how the table looks. First, you can specify the sorting rules. Next, you can enable or disable pagination, which is most useful when you have a lot of data. Finally, you can limit the number of rows to show: 10, 20, 40 or all rows.
When you're ready, click on Next Step, which will take you to a brand new screen. The latest additions to WP Table Manager allow you to do three new things, and two of them are here. The first option is to allow table editing. By default, the Allow editing switch is off, which means that you cannot edit cell content, but now you can toggle it on.
If you allow table editing, you need to be careful. You need to choose a base column for row identification, or the primary key, from the dropdown on the right. This dropdown exists because when you are editing the table, you are also editing the database.
Just below, you can preview the MySQL script used to generate the table. You do not have to edit this script yourself; WP Table Manager generates it automatically from the settings you chose earlier. However, if you are an SQL programmer, you can tweak the script. Click on Apply whenever you update the MySQL script.
When you are done, you can preview the table, and if you're satisfied, create the table. Once WP Table Manager creates the table, the plugin will take you to the table editor. If you enabled cell editing, you can change the cells' contents; otherwise, the cells will be greyed out.
Before you leave the table editor, there is one more new feature. If your intention is to display the table to your WordPress users, you might want to hide certain columns in the frontend while keeping them in the backend. To hide columns in the frontend, simply right click on a column name and click on the first option; repeat the process if you want to show the column.
After creating the database table, all of WP Table Manager's features are at your disposal. You can create charts from the Chart menu or embed the table in any post or page. Simply head to a post or a page, click on WP Table Manager, navigate to the newly-created table and insert it!
Tables created in this way are maintained automatically, which means that as data changes in your database, the modifications are reflected right away in your tables. So go ahead, create your tables, visualize them with ease, and share them with your WordPress users.
Do you want to start using database tables on WordPress? Get WP Table Manager from here!