-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtable.html
More file actions
23 lines (22 loc) · 801 Bytes
/
table.html
File metadata and controls
23 lines (22 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.2/papaparse.js"></script>
<script>
function arrayToTable(tableData) {
var table = $('<table></table>');
$(tableData).each(function(i, rowData) {
var row = $('<tr></tr>');
$(rowData).each(function(j, cellData) {
row.append($('<td>' + cellData + '</td>'));
});
table.append(row);
});
return table;
}
$.ajax({
type: "GET",
url: "https://docs.google.com/spreadsheets/d/e/2PACX-1vS6JJL3ePsnRKYtZ2926L8KnmujZIPi5EpRPtNLveuGiMyNcDlawbfbcydOZK3PI6fDgLeunx_3NFWm/pub?output=csv",
success: function(data) {
$('body').append(arrayToTable(Papa.parse(data).data));
}
});
</script>