How to display my JSON data into table using DataTable plug-in?

As per the document here ,i have implemented the server side code.

JS code

$('#datatable_paging').dataTable({
                    "bProcessing": true,
                    "bServerSide": true,
                    "sAjaxSource": "#### my php file path ####",


                });

I am getting JSON data as

{
    "sEcho": 0,
    "iTotalRecords": 19,
    "iTotalDisplayRecords": "19",
    "aaData": [
        ["1", "peter", "peter@gmail.com"],
        ["2", "john", "john@yahoo.com"],
        ["3", "raj", "raj@in.com"],
        ["4", "selvin", "selvin@gmail.com"],
        ["5", "ismail", "ismail@gmail.com"],
        ["6", "muadth", "muad@hotmail.com"],
        ["7", "ahmed", "ahmed@gmail.com"],
       .....
    ]
}

Now i need to display this JSON result in below table with Datatable pagination

HTML code

    <table id="datatable_paging">
        <thead>
          <tr>
            <th>Id </th>
            <th>Name</th>
            <th>E-mail</th>

          </tr>
        </thead>

  </table>

Leave a Reply

*

Hire Me
Follow Me!
Search
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.
Categories