Javascript 为阵列输出创建Google应用程序脚本GUI

Javascript 为阵列输出创建Google应用程序脚本GUI,javascript,arrays,user-interface,google-apps-script,Javascript,Arrays,User Interface,Google Apps Script,我需要在谷歌应用程序脚本中为我的阵列输出创建一个GUI。谷歌搜索了3个小时,却找不到如何在谷歌应用程序脚本中输出数组的解决方案。有什么想法吗?一个电子表格中的二维数组GUI function guioutput() { const ss=SpreadsheetApp.getActive(); const sh=ss.getSheetByName('Sheet1'); const rg=sh.getDataRange(); const vA=rg.getValues(); va

我需要在谷歌应用程序脚本中为我的阵列输出创建一个GUI。谷歌搜索了3个小时,却找不到如何在谷歌应用程序脚本中输出数组的解决方案。有什么想法吗?

一个电子表格中的二维数组GUI

function guioutput() {
  const ss=SpreadsheetApp.getActive();
  const sh=ss.getSheetByName('Sheet1');
  const rg=sh.getDataRange();
  const vA=rg.getValues();
  var html='<style> th,td{border:1px solid black;}</style><table>'
  vA.forEach(function(r,i){
    html+='<tr>';
    r.forEach(function(c,j){
      if(i==0) {
        html+=Utilities.formatString('<th>%s</th>',c);
      } else {
        html+=Utilities.formatString('<td>%s</td>',c);
      }
    });
    html+='</tr>';
  });
  html+='</table>';
  SpreadsheetApp.getUi().showModelessDialog(HtmlService.createHtmlOutput(html), "Your GUI is less than ten minutes")
}
函数guioutput(){
const ss=SpreadsheetApp.getActive();
const sh=ss.getSheetByName('Sheet1');
const rg=sh.getDataRange();
const vA=rg.getValues();
var html='th,td{border:1px纯黑色;}'
vA.forEach(函数(r,i){
html+='';
r、 forEach(函数(c,j){
如果(i==0){
html+=Utilities.formatString(“%s”,c);
}否则{
html+=Utilities.formatString(“%s”,c);
}
});
html+='';
});
html+='';
SpreadsheetApp.getUi().showModelessDialog(HtmlService.createHtmlOutput(html),“您的GUI不到十分钟”)
}
这里有一个数据表可以测试它

可乐 可乐 可乐 可乐 可乐 可乐6 可乐 可乐 可乐 可乐 21 24 2. 24 21 18 24 20 3. 19 4. 23 3. 17 16 5. 18 7. 5. 12 1. 8. 5. 9 5. 9 22 5. 12 14 18 10 21 5. 2. 23 13 4. 2. 12 15 1. 6. 17 0 18 20 22 2. 18 14 13 13 12 23 9 16 20 5. 6. 18 0 11 23 23 5. 10 24 19 18 13 2. 9 10 19 8. 3. 10 24 6. 4. 10 19 4. 16 22 11 16 11 3. 8. 13 17 17 10 23 21 10 6. 15 7. 5. 18 15 14 1. 19 24 5. 21 23 4. 10 3. 20 9 24 0 19 23 18 2. 19 1. 2. 16 3. 6. 16 7. 13 19 7. 1. 7. 1. 18 20 18 6. 16 19 10 1. 6. 20 2. 6. 21 16 12 24 12 20 9 12 4. 14 15 21 21 2. 18 6. 18 19 15 10 11 0 24 3. 1. 10 19 24 18 21 1. 10 16 12 18 18 4. 5. 23 13 9 17 4. 13 3. 22 8. 6. 1. 3. 11 2. 21 20 8. 1. 4. 18 7. 21 22 7. 23 12 13 0 22 22 9 22 6. 1. 0 24 21 24 14 12 16 6. 17 12 17 1. 2. 20 1. 2. 2. 3. 24 10 15 17 3. 18 5. 16 9 2. 15 11
你必须更加具体,这可能是你在谷歌上搜索了3个小时却什么也没找到的问题。描述什么是输入,什么是期望的输出。提供一些示例、屏幕截图、表格或更具体的内容。理想情况下,我们希望您为解决方案编写一些代码(或做出一些努力)。请尝试以下操作:
SpreadsheetApp.getUi().showModeLess(HtmlService.createHtmlOutput)(your.array.join('
'),“Title”)