Penco Invitational Leaderboard
table {
border-collapse: collapse;
width: 100%;
max-width: 100%;
}
table th, table td {
border: 1px solid #ddd;
padding: 8px;
text-align: center;
}
table th {
text-align: left;
background-color: #f2f2f2;
}
/* Style every other row with a different background color */
table tr:nth-child(even) {
background-color: #f9f9f9;
}
/* Make the table responsive on smaller screens */
@media only screen and (max-width: 600px) {
table th,
table td {
padding: 4px;
font-size: 12px;
}
}
@media only screen and (max-width: 768px) {
.table td,
.table th {
font-size: 14px;
}
}
table tbody tr td {
text-align: center;
}
table {
width: 100%;
max-width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
# |
Namn |
R1 |
R2 |
R3 |
R4 |
R5 |
Antal rundor |
Totala poäng |
3 bästa |
// The ID of the Google Sheets document
var sheetID = ‘1Hg8Vu7UvkOg-cVvz2iwXASsbxU4u7XlPC0A1AQAneDQ’;
// The API key for accessing the Google Sheets API
var apiKey = ‘AIzaSyDAvxW-V3LkCmZH9DxP03SqHsralZmXxVY’;
// The range of data to retrieve from the Google Sheets document
var range = ‘2023!A2:J22’;
// The URL for fetching data from the Google Sheets API
var url = ‘https://sheets.googleapis.com/v4/spreadsheets/’ + sheetID + ‘/values/’ + range + ‘?key=’ + apiKey;
// Function to fetch data from the Google Sheets API and populate the table
function fetchData() {
fetch(url)
.then(response => response.json())
.then(data => {
// Extract the rows of data from the API response
var rows = data.values;
// Get a reference to the table body
var tbody = document.getElementById(‘leaderboard-body’);
// Loop through each row of data and create a table row
for (var i = 0; i {
console.error(error);
});
}
// Call the fetchData() function to populate the table
fetchData();