问题
I have a Google spreadsheet with data that will be updated on a weekly basis. I need to bring this data into a HTML table on my website.
Rather than running it through a CSV to HTML converter each time and having to update the HTML code each time, is there a way for me to use PHP or Javascript to look up the Google Spreadsheet URL and convert the data to HTML Table tags without me needing to alter the code each time?
回答1:
You may be interested in GD API (description concerning spreadsheets).
Default download format is html. Write a script and run in using CRON once a day to pull newest version of you document.
回答2:
Open your spreadsheet, go to File > Download as > Web page (.html, current sheet)
That should open a link in a new window. This should automatically update when you reload the page after the data has been edited. In jQuery, you can use the .load function to load the data into your page.
来源:https://stackoverflow.com/questions/11775476/converting-google-spreadsheet-to-html-table