How to display API data in HTML table using JS for La Liga standings?

I am trying to make a table that gets results from a football league but I cant figure out how to display it as my current code won’t work. I tried to use JSON as the Data could come in JSON. I’ve tried looking at other solutions and tried to implement them but unfortunately they still don’t work, any help would be appreciated.

Code:

fetch("https://api.football-data.org/v2/competitions/2014/standings", {
    "method": "GET",
    "headers": {
      "x-rapidapi-host": "https://www.football-data.org/",
      "x-rapidapi-key": "c57d4c72c6b0436ab0d235d1ae77ebbd"
    }
  })
  .then(response => response.json())
  .then(data => {
    const tableBody = document.querySelector('table tbody');
    const standings = data.standings[0].table;
    div.innerText = JSON.stringify(data);

    standings.forEach((team, index) => {
      const row = document.createElement('tr');

      const positionCell = document.createElement('td');
      positionCell.textContent = index + 1;
      row.appendChild(positionCell);

      const teamCell = document.createElement('td');
      teamCell.textContent = team.team.name;
      row.appendChild(teamCell);

      const playedCell = document.createElement('td');
      playedCell.textContent = team.playedGames;
      row.appendChild(playedCell);

      const wonCell = document.createElement('td');
      wonCell.textContent = team.won;
      row.appendChild(wonCell);

      const drawnCell = document.createElement('td');
      drawnCell.textContent = team.draw;
      row.appendChild(drawnCell);

      const lostCell = document.createElement('td');
      lostCell.textContent = team.lost;
      row.appendChild(lostCell);

      const pointsCell = document.createElement('td');
      pointsCell.textContent = team.points;
      row.appendChild(pointsCell);

      tableBody.appendChild(row);
    });
  })
  .catch(error => {
    console.log(`Error fetching standings data: ${error.message}`);
  });
<h1>La Liga Standings</h1>
<table>
  <thead>
    <tr>
      <th>Position</th>
      <th>Team</th>
      <th>Played</th>
      <th>Won</th>
      <th>Drawn</th>
      <th>Lost</th>
      <th>Points</th>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>