1. let myJSON = { ... };
2. let myDOMContainer = document.getElementById("myDOMContainer");
3. JSON2Table.init(myJSON, myDOMContainer);
There is a known issue with this script that I couldn't fix yet.
All properties in the JSON must have a unique name,
or the properties with the same name, must be in exactly the same nested order.
If there are two or more properties with the same name and different nested order
the script fails to place them to the right position.
Example:
// This fails, due to the different nested depth of properties with same name
{
"myProp1": {
,"samePropertyName": {
"prop1": 1
}
,"notWorking": {
"samePropertyName": {
"prop1": 1
}
}
}
}
// This still works, due to the same nested depth
{
"myProp1": {
,"workingOne": {
,"samePropertyName": {
"prop1": 1
}
}
,"workingTwo": {
"samePropertyName": {
"prop1": 1
}
}
}
}