Using WP_List_Table to Create WordPress Admin Tables
read more
Categories

Using WP_List_Table to Create WordPress Admin Tables


In the WordPress dashboard, the tables that displays the posts, pages and user data are all created internally by WordPress using the WP_List_Table PHP class.

Below are a couple of screenshots of the post and user admin pages:

As a plugin developer, the need to build a custom table that will contain a given data might arise. Rather than code your own table design, it’s best you use that of WordPress in order for your plugin settings page to conform to WordPress UI.

While you might be tempted to copy the HTML and CSS table design by viewing the source code of WordPress, you shouldn’t because the WP_List_Table class is there to help.

My acquaintance with WP_List_Table stemmed from my experience building the ProfilePress plugin. I actually used it to display the list of created user account forms in table form.