Using datatables in server side.
Using datatables in server side.
I'm a beginner to web development, I'm trying to display a table in a webpage file(say: "index.php"), it'll be generated on my server side PHP script by querying my database(say:"backend.php"). I'm using AJAX request(using jquery in "request.js") to fetch the table to "index.php" from "backend.php". I currently have my table styling inline in "backend.php" and using echo command in "backend.php" to display the table through response
in "request.js".
1.Where should I include my script src and javascript code?
2.Please guide me to use DataTables in a proper way to sort and search tables.
A tiny example code will be very helpful.
This question has an accepted answers - jump to answer
Answers
This example shows a simple DataTable and how the HTML might be constructed. It also has search and sort for the table through a simple
$().DataTable()
call.If you want to Ajax load the data, please refer to the manual and also the examples of which there are many.
Allan
Thanks a lot Allan, I started getting to know about this.