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 8808733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:41:43+00:00 2026-06-14T02:41:43+00:00

im newbie at all and learnt to move my old style coding to these.

  • 0

im newbie at all and learnt to move my old style coding to these.
and now I need helps.

my JSON (array) – result from my php json_encode:

{"e_id":"12101","e_password":kkkk,"e_secretQuestion":null
{"e_id":"12102","e_password":kkkk,"e_secretQuestion":"abc"}
{"e_id":"12103","e_password":kkkk,"e_secretQuestion":"abc"}

my jquery:

e.preventDefault();
$.post("/general/helper.php?page=login",$(this).serialize(),function(data,status){          
    if (data != null){
        var tblheader = "<table><tr>";  
        var tblbody= "";    
        $.each(data, function(i, field){
            tblbody = tblbody + "<td style='border:1px solid gray'>" + field + "</td>";
        });
        tblbody = tblheader + tblbody + "</tr></table>";
        $("#hasil").html(tblbody);
    }
},"json");  

Question:

Its only format onto a table if return 1 row only, but if more rows the table is not formatted…
pls help, how to simply format it to table? at this moment, please don’t suggest me to use plugin to format json array to table.

thanks

  • 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-14T02:41:44+00:00Added an answer on June 14, 2026 at 2:41 am

    If your data is a parsed JSON array, when your code should look like that:

    e.preventDefault();
    $.post("/general/helper.php?page=login",$(this).serialize(),function(data,status){          
        if (data != null){
            var tblbody = "<table>";    
            $.each(data, function(i, row){
                tblbody += '<tr>';
                $.each(row, function(i, field) {
                    tblbody += "<td style='border:1px solid gray'>" + field + "</td>";
                });
                tblbody += '</tr>';
            });
            tblbody += "</table>";
            $("#hasil").html(tblbody);
        }
    },"json");  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am newbie in KnockoutJs , i tried all tutorials on its official website. Now
I have these these two functions //Remove all even indexed elements from a list
I'm learning Prolog from Learn prolog now book. I'm quite newbie in prolog and
I'm a newbie to all the Sencha Touch stuff, but until now I'm very
dear all.i newbie at web programming and until now i still have learn about
I'm a newbie to all this ASP.NET MVC stuff, and I was making some
I am a newbie in all this as will be apparent really soon. I
First of all, I checked all the newbie mistakes. According to Firebug, that element
Newbie question since I'm not up to speed using maven at all. I'm trying
Dear All, please help me since I'm newbie in SQL Server. I have a

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.