在网页中显示Google表格单元格的内容 [英] display the content of a google sheet cell in a web page
本文介绍了在网页中显示Google表格单元格的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含html代码的单元格的Google表单。我想知道在网页中显示此html的最佳方式。我已经尝试过使用Google电子表格API和Google可视化API ... 使用使用 Google Apps Script ,这可以很简单:
函数的doGet(){
变种电子表格= SpreadsheetApp.openById( 0Aq4s9w_HxMs7dFVuQ0hDaWl1VVZsQ1RBTVZqM0dHLXc); //替换为您的图纸ID
var html = spreadsheet.getRange(A1)。getValue(); //我的html在单元格A1
中返回HtmlService.createHtmlOutput(html);
}
查看 Apps脚本文档快速入门和教程部分,了解如何使用Apps Script进行开发。
I have google sheet with a cell containing html code. I would like to know the best way to show this html in a webpage. I have tried with google spreadsheets API and google visualization API...
解决方案
Using Google Apps Script, this can be as simple as:
function doGet() {
var spreadsheet = SpreadsheetApp.openById("0Aq4s9w_HxMs7dFVuQ0hDaWl1VVZsQ1RBTVZqM0dHLXc"); // replace with your sheet id
var html = spreadsheet.getRange("A1").getValue(); // My html is in cell A1
return HtmlService.createHtmlOutput(html);
}
Check out the Apps Script documentation Getting Started and Tutorial sections to get an idea of how to develop with Apps Script.
这篇关于在网页中显示Google表格单元格的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文