O'Reilly logo

CodeIgniter 2 Cookbook by Rob Foster

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using an HTML table with DataTable and a database

CodeIgniter comes with a useful library to handle HTML tables. It's simple to use and is able to handle most of the things you would need it for. Here, in this recipe, we're going to use it with DataTable to create an interactive HTML table that is sortable and searchable. It even has pagination! This recipe populates the table using a database query. If you're not looking for that and just want a simple table, try the preceding recipe—Using an HTML table with DataTable.

Getting ready

For this recipe, you will have to:

  1. Ensure that you've downloaded DataTable from https://datatables.net/download/.
  2. Unzip the downloaded .zip file, and move the files to a location on your web server or localhost, which ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required