Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8962115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:03:42+00:00 2026-06-15T16:03:42+00:00

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

  • 0

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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:03:43+00:00Added an answer on June 15, 2026 at 4:03 pm

    People answering this are overthinking this way too much. Datatables will handle the output without any fancy looping/assigning/etc when you set the options correctly. Assuming your JSON return is proper as described in the spec:

    HTML:

     <table id="datatable_paging"></table>
    

    Then the jQuery:

    var oTable = $('#datatable_paging').dataTable( {        
            "bDestroy":true,
            "bStateSave": true,
            "aaSorting": [[1, "asc"]], 
            "bProcessing": true,
            "bServerSide": true,
            "sAjaxSource": "#### my php file path ####",
            "bJQueryUI": true,
            "bAutoWidth": false,
            "bFilter":true,
            "bLengthChange": true,
            "bPaginate": true,
            "bSort": true,
            "iDisplayLength": 10,
            "bInfo": true,
            "sPaginationType": "full_numbers",
            "aoColumns": [
                { "sTitle": "Id", "sWidth": "33%"},
                { "sTitle": "Name", "sWidth": "33%"},
                { "sTitle": "Email", "sWidth": "33%"}
            ]
        })
    

    The paging, etc is going to be setup properly, assuming that your PHP source is correctly filtering as it should. If, for example, you find that you’re getting 19 results when you should be getting 10, you’d know that the problem is at your source, not here in the jQuery. In your example, the source says it’s returning 19 total result out of 19 and bPaginate hasn’t been specified, so that would be why the paging isn’t working. aoColumns setups your head, no need to do in HTML unless you really want to. The other functions are well-documented on the datatables site, though ask questions if you’re confused.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As per API document, credentials_blob_updated callback is called when storable credentials have been updated.
I have a webpage that dynamically prepends new divs about once per minute. Here
I have the following javascript code (at bottom) that I inject per api call
Here is what I have so far: var hoveredElement; //none per default ;(function($){ $.fn.isHovered
UPDATE: Code has been updated per Dan's comments. I have a problem with a
Basically what we have here Getting the headings from a Word document Public Sub
I have written a xml/php document that is pulling from a Magento Commerce database,
My application is document based and memory usage per document is quite high in
I have a large website at www.mydomain.com. There are 1000 new documents per month
I'm posting documents to the SOLR server, roughly 5000 documents at a time per

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.