Если я правильно понимаю ваш вопрос, вы пытаетесь добавить значения в таблицу с помощью последовательных вызовов функции javascript, которая выбирает для вас новые результаты?
<script>
fetch("https://asdasd.free.beeceptor.com/a", {
method: "GET",
headers: {
"x-api-key": "p*****w"
}
}).then(res => {
res.json().then(data => {
//Here assuming that data is an array of objects
//var data = : { "id": "145127236", "mygoals": "success", "future": "high", "dole": { "Key": "fhd699f" } },
ids = document.getElementById("ids")
goals = document.getElementById("goals")
futures = document.getElementById("futures")
ids.insertAdjacentHTML("afterend", "<td>" + data.id + "</td>");
goals.insertAdjacentHTML("afterend", "<td>" + data.mygoals + "</td>");
futures.insertAdjacentHTML("afterend", "<td>" + data.futures + "</td>");
}
)
}).catch(err => {
console.log("ERROR: " + err);
});
</script>
Обратите внимание, что я изменился innerHtml = temp
для .insertAdjacentHTML("beforeend", temp);
. Это добавляет содержимое переменной temp вместо замены html of #data значением temp.
EDIT: изменение макета таблицы в соответствии с адаптивными таблицами в Bootstrap 4.
<div class="table-responsive">
<table class="table table-stripped">
<tbody>
<tr>
<th id="ids">emp id</th>
</tr>
<tr>
<th id="goals">emp goals</th>
</tr>
<tr>
<th id="futures">emp futures</th>
</tr>
</tbody>
</table>
</div>
Здесь я настроил скрипку с простой демонстрацией без bootstrap базовой демонстрации