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

  • SEARCH
  • Home
  • 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 6130419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:51:22+00:00 2026-05-23T16:51:22+00:00

I have the following JSON structure: {rows: [ {row:[ {cells: [ {data: Edit}, {data:

  • 0

I have the following JSON structure:

{"rows": [

      {"row":[  
             {"cells": [
                   {"data": "Edit"},
                   {"data": "Add"}
             ]}
      ]},
      {"row":[
             {"cells": [
                   {"data": 1},
                   {"data": 2}
             ]}
      ]}
]} 

For every “row” in the JSON file, there will be a table row and for every “data” a row column.

My code looks like this:

$.each(response.rows, function(index, rows){

     $.each(rows.row, function(index, row){
          $("tbody").append("<tr>"); 
          $.each(this.cells, function(){ 
               $("tr").append("<td>" + this.data + "</td>");
          });
          $("tbody").append("</tr>");
     });
}); 

My code is generating the table rows/columns like this:

Row 1 -- I get 4 columns with values "Edit"/"Add"/1/2 
Row 2 -- I get 2 columns with values 1/2. 

If I add another “row” in JSON file, then Row 1 & 2 are rendered incorrectly.

Row 1 should only have 2 columns with values “Edit”/”Add”. The JSON structure seems right.

Can someone please tell me what I’m doing wrong? Thank you.

  • 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-05-23T16:51:23+00:00Added an answer on May 23, 2026 at 4:51 pm

    It’s your syntax: http://jsfiddle.net/SXzny/ That fixes it, because it doesn’t reference all tags, but the one you created.

    For example, replace:

    $.each(rows.row, function(index, row){
      $("tbody").append("<tr>"); 
      $.each(this.cells, function(){ 
           $("tr").append("<td>" + this.data + "</td>");
      });
      $("tbody").append("</tr>");
    });
    

    with:

    $.each(rows.row, function(index, row){
      var element = $("tbody").append("<tr>"); 
      $.each(this.cells, function(){ 
           element.append("<td>" + this.data + "</td>");
      });
      $("tbody").append("</tr>");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have parsed a json object that has the following structure: { data =
I have a structure similar to the following: /root/ /root/data/ /root/data/script.php /root/data/some.json /root/data/feature/one.json /root/data/feature/two.json
I have the following JSON structure: [{ id:10, class: child-of-9 }, { id: 11,
I have the following json code file named: sections.json { section1: { priority: 1,
I have a configuration file in the following JSON format: { key1: value1, key2:
I have the following javascript: $.ajax({ type: "POST", dataType: "json", url: "/Home/Submit", data: {
I have a json object that follows the following structure: $foo->bar['1']->#foobar The hash is
I have the following JSON: { @id: hey there, id: hey there 2 }
I have the following JSON structure: { headers:[ {title: Action, width: 3, class: centeralign},
I have the following JSON file as input, { $type: NanoWebInterpreter.WebInputData, NanoWebInterpreter, NBBList: {

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.