use*_*567 16 border colors google-sheets google-apps-script
Google Spreadsheet在工具栏下方的边框按钮上还有一个按钮,用于更改颜色和更改边框样式.
如何在Google Apps脚本中访问这些内容?
setBorderColor对文档描述的功能似乎不适用于电子表格.
Mog*_*dad 11
截至2016年1月12日,已报告的问题已得到修复.范围现在有这些方法:
文档中提供了示例; 这是如何设置虚线红色边框*:
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var cell = sheet.getRange("B2");
// Sets borders on the top and bottom, but leaves the left and right unchanged
// Also sets the color to "red", and the border to "DASHED".
cell.setBorder(true, null, true, null, false, false, "red", SpreadsheetApp.BorderStyle.DASHED);
Run Code Online (Sandbox Code Playgroud)
*更正,根据评论:文档错误,应该是SpreadsheetApp.BorderStyle.DASHED/DOTTED/SOLID,而不是Range. - gotofritz