我試圖在HTML表格中顯示JSON數據,但我不知道如何。我試圖使用jQuery。如何根據使用jquery的動態數據在html表格上顯示JSON數據?
我的數據是這樣的:
{
"error": "",
"response_code": 200,
"position": "Train Arrived at Barauni Jn. (BJU) at 05:45 PM",
"train_number": "12554",
"total": 21,
"route": [
{
"status": "No Delay",
"actdep": "07:50 PM",
"station": "New Delhi (NDLS)",
"actarr": "12:00 AM",
"no": 1,
"scharr": "Source",
"schdep": "07:50 PM"
}, {
"status": "4 Minutes Before",
"actdep": "08:28 PM",
"station": "Ghaziabad (GZB)",
"actarr": "08:26 PM",
"no": 2,
"scharr": "08:30 PM",
"schdep": "08:32 PM"
},
//...
{
"status": "30 Minutes Late",
"actdep": "N/A",
"station": "Barauni Jn (BJU)",
"actarr": "05:45 PM",
"no": 21,
"scharr": "05:15 PM",
"schdep": "Destination"
}
]
}
你應該先格式化你的問題,然後發佈你嘗試過什麼等等遠? –