I've been working with dynamic HTML tables through JSON data for the past like two months, and it's been working great. However the only codes I've been using to make tables use array items to make a single row through .forEach(), which is fine for what I've been doing so far, but now I need something else.
For example, among more data, I have the following JSON:
{"songs":[
{
"name":"Manatsu wa Dare no Mono?",
"id":159,
"attribute":"smile",
},
{
"name":"Jimo Ai♡Mantan☆Summer Life",
"id":160,
"attribute":"pure"
},
{
"name":"Natsu no Owari no Amaoto ga",
"id":161,
"attribute":"cool"
}
]
}
Instead of making a table that would look like:
Manatsu wa Dare no Mono? | 159 | smile Jimo Ai♡Mantan☆Summer Life | 160 | pure Natsu no Owari no Amaoto ga | 161 | cool
which is what my codes do, I would instead like to have a table that would make 3 rows for every 3 items, for example, it would look like this:
Manatsu wa Dare no Mono? | Jimo Ai♡Mantan☆Summer Life | Natsu no Owari no Amaoto ga 159 | 160 | 161 smile | pure | cool
I can't use .forEach() for this because I have no way to specify that I only want three columns (unless I do, and I just can't see how at all).
I figured I might have to use a regular for loop, and do something like i < 3 but I honestly can't think of any way that this would make sense in terms of looping through the data the way I want to.
Is this possible at all? Any help is much appreciated.
Edit: the full JSON is here (has way more than 3 items). Basically I want to make a table of every item in this array, with one row for every three items, but it also shouldn't list every key for every item (only name, id, attribute).