I am having a problem displaying my json object inside a table using DataTables
plug-in.
This is my json object:
{
"data":[
{
"attributes":{
"siteID":"0002"
},
"date":{
"attributes":{
"dateValue":"20200304"
},
"traffic":[
{
"attributes":{
"code":"01",
"exits":"0",
"enters":"0",
"startTime":"000000"
}
},
{
"attributes":{
"code":"01",
"exits":"0",
"enters":"0",
"startTime":"010000"
}
},
{
"attributes":{
"code":"01",
"exits":"0",
"enters":"0",
"startTime":"020000"
}
},
{
"attributes":{
"code":"01",
"exits":"0",
"enters":"0",
"startTime":"030000"
}
}
]
}
},
{
"attributes":{
"siteID":"0004"
},
"date":{
"attributes":{
"dateValue":"20200304"
},
"traffic":[
{
"attributes":{
"code":"01",
"exits":"0",
"enters":"0",
"startTime":"000000"
}
},
{
"attributes":{
"code":"01",
"exits":"0",
"enters":"0",
"startTime":"010000"
}
},
{
"attributes":{
"code":"01",
"exits":"0",
"enters":"0",
"startTime":"040000"
}
},
{
"attributes":{
"code":"01",
"exits":"0",
"enters":"0",
"startTime":"030000"
}
}
]
}
}
]
}
I did add the table rows manually and it works fine: this is a screenshot of the result. But I would like that the table body will be created dynamically using my json object.
I am really new to this and I would appreciate some help. Thakn you.