簡體   English   中英

Google電子表格到HTML(可編輯)

[英]Google Spreadsheet to HTML (editable)

我有我的Google電子表格(GS)文件,但它不是“設計豐富”。 我想在HTML網頁上進行設計,並以某種方式“合並”Google Sheet,因此用戶仍然可以在字段中輸入值並獲得計算結果。

只有GS和HTML網頁之間的區別在於網頁將為單元格設計一些背景。

我的方法是提供一個自定義菜單來呈現所選單元格的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