为数组outuput创建Google应用程序脚本GUI



我需要在Google应用程序脚本中为数组输出创建一个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")
}

这是一个测试它的数据表。

COL1COL8COL9COL10
21319
4512
11214
18212
15218
1456
181918
13246
4113
8615
7521
231923
18167
13186
162116
121521
21110
24110
16917
4112
21227
2361
01712
172410
151511

相关内容

最新更新