const SPREADSHEET_ID = 'your_spreadsheet_id'; // Замените на ID вашей Google Sheets
const SHEET_NAME = 'Sheet1'; // Замените на название листа
const account_id = 'your_account_id'; // Замените на ID вашей Google Sheets
const token = 'your_token'; // Замените на ID вашей Google Sheets
fetch(`https://sheets.googleapis.com/v4/spreadsheets/${SPREADSHEET_ID}/values/${SHEET_NAME}!A1:Z100?key=${token}`)
.then(response => response.json())
.then(data => {
const values = data.values;
const table = document.createElement('table');
// Создаем шапку таблицы
const headerRow = table.insertRow();
values[0].forEach(headerText => {
const headerCell = headerRow.insertCell();
headerCell.textContent = headerText;
});
// Заполняем таблицу данными
for (let i = 1; i < values.length; i++) {
const row = table.insertRow();
values[i].forEach(cellText => {
const cell = row.insertCell();
cell.textContent = cellText;
});
}
document.getElementById('table-container').appendChild(table);
});