Link to home
Start Free TrialLog in
Avatar of EnolaKotrotsos
EnolaKotrotsos

asked on

Building simple table from JSON.

Goodevening,

I am trying to build a html table from a json string which mostly looks like this

{'records': [{'id':'po-0167','x':'xx'},{'id':'po-0783', 'y':'yy'}]}

But I can't figure out how to formulate the loop required. I want a table, with 2 rows in this case (but that of course depends on how many records there are) and in this case 2 columns (but again, depends on the number of colums in the string...which varies)

the json can also look like

{'records': [{'id':'234','name':'marco','age':24},{'id':'0783', 'name':'silvia','age':33}]}

etc

how do I loop over this object without running out of scope or anything and have a html table build? (the table building itself is not important....)

Hope someone can provide me with an example.
Thank you very much.
Marco
ASKER CERTIFIED SOLUTION
Avatar of MikeRCWatts
MikeRCWatts

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of EnolaKotrotsos
EnolaKotrotsos

ASKER

Mike, thank you very much- that even went completely beyond my expectations! You are amazing..:) Thanks again for your help...
Its just what I have been looking for :)