How to create a searchable and sortable data table in wordpress using wpDataTables Lite Plugin.

I have chosen this plugin as the lite version can fetch data from a publicly hosted CSV file.

As part of this setup I have created a database table with columns company, url, phone, hourly rate, 10 hour rate etc

The written a php script to that reads this information from the table and renders a CSV file. The wpDataTables plugin does not like CSV files where the url ends with .php, so I have also used .htaccess rewrite to be able to request a .csv but actually serve a .php file.

Here is the data table in action:

Generated by wpDataTables