A jQuery plugin that allows you to convert a google spreadsheet into an array of JSON objects.
<script src="https://gsr-jquery.netlify.com/gsr.jquery.js"></script>
Given this Google Spreadsheet, we want to create a table. With this jQuery plugin it can be achieved in a few easy steps.
$.gsr(documentID, callback);
which passes the document ID and the callback function.The function returns a JSON object with two keys: knownHeaders and table.
{
knownHeaders: ["first name", "last name", "gender", "age"],
table: [
{first name: "john", last name: "smith", gender: "male", age: "23"},
{first name: "jane", last name: "smith", gender: "female", age: "24"},
{first name: "pete", last name: "strong"},
{first name: "johnny", last name: "appleseed", age: "19"}
}
Now that we understand the general concept we can create the following table based on the above spreadsheet:
All that is needed is less than 50 lines of code: