在您的 HTML 标记中
<table id="data">
</table>
在你的脚本标签中
var url="http://jendela.data.kemdikbud.go.id/api/index.php/ccarisanggar/searchGet";
$.ajax({
type: "GET",
url: url,
cache: false,
// data: obj_data,
success: function(res){
console.log("data",res);
//if you want to remove some feild then delete from below array
var feilds =["sanggar_id","kode_pengelolaan","nama","alamat_jalan","desa_kelurahan","kecamatan","kabupaten_kota","propinsi","lintang","bujur","tahun_berdiri","luas_tanah"];
var html='';
html+=`<thead>
<tr>`;
$.each(feilds,function(key,val){
html+=`<th class="${val}">${val}</th>`;
})
html+=`</tr>
</thead>
<tbody>`;
$.each(res.data,function(key,val){
html+=`<tr>`;
$.each(feilds,function(aaa,feild){
html+=`<th class="${val[feild]}">${val[feild]}</th>`;
})
html+=`</tr>`;
})
html+=`</tr>
</tbody>`;
$("#data").html(html);
},
});