I have a an html file that has this snippet in it.
<div>
<table id="apps"></table>
</div>
I am receiving JSON data that looks like this:
{
"1": [
{
"A": "",
"B": "",
"C": "",
"D": "",
"E": ""
}
]
}
There will be exactly one "1" , but there can be more than one dictionary within the list of "1". In this example, we only have one {} within the list, [] , but there can exist multiple {} of containing exactly five items like what is shown above.
I want to create a table from this data, where each row represents a single {} within the [] and has five columns representing A, B, C, D, E respectively.
I am unsure if I should have the structure of this, the tags already in my html(this is not in my html code provided) and then populate these tags or should my function that loads this data in my html file, access table id="apps" and create these tags and then populate these tags? Which is better? and How might one accomplish this efficiently?