简体   繁体   English

Google电子表格到HTML(可编辑)

[英]Google Spreadsheet to HTML (editable)

I have my Google Spreadsheet (GS) file, but it is not 'design rich'. 我有我的Google电子表格(GS)文件,但它不是“设计丰富”。 I would like to make a design on HTML Web Page, and somehow "merge" Google Sheet with it, so users can still input values in fields and get calculated results. 我想在HTML网页上进行设计,并以某种方式“合并”Google Sheet,因此用户仍然可以在字段中输入值并获得计算结果。

Only difference between GS and the HTML Web Page is that the web page will have some designed background for cells. 只有GS和HTML网页之间的区别在于网页将为单元格设计一些背景。

My way is to provide a custom menu that render the html content of selected cell: I compiles several sample to get this simple result: 我的方法是提供一个自定义菜单来呈现所选单元格的html内容:我编译了几个样本来获得这个简单的结果:

// This will run when the spreadsheet is opened or the browser page is refreshed
function onOpen() {
  SpreadsheetApp.getUi()
      .createMenu('Custom Menu')
      .addItem('HTML Vue', 'openDialog')`enter code here`
      .addToUi();
}

function openDialog() {
  var ss = SpreadsheetApp.getActive();
  var cell = ss.getActiveCell();  
  var html = HtmlService.createHtmlOutput(cell.getValue());
  SpreadsheetApp.getUi().showModalDialog(html, 'HTML Vue:' );
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM