如何解决如何在 Google 表格中插入浮动免责声明
我有一个 Google 电子表格,顶部包含免责声明(免责声明作为警告消息)。但是,我希望在我滚动时将此免责声明放下。 冻结面板功能对我不利,因为我只想取消免责声明。有人可以帮我写那个吗?
提前致谢。
解决方法
您可以使用 custom sidebars 来表示您的免责声明。
示例代码.gs:
function showSidebar() {
var html = HtmlService.createHtmlOutputFromFile('Page')
.setTitle('Disclaimer');
SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp.
.showSidebar(html);
}
Sample Page.html:(您可以在线查找 HTML 教程,这里有一个reference)
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<h1 style="color:red"> DISCLAIMER </h1>
Hello,world! This is a disclaimer ........<br>
<br>
You can add more information here
</body>
</html>
输出:
您也可以将此脚本用作 onOpen installable trigger,这样无论何时打开文件,都会自动显示自定义侧边栏。
要在脚本编辑器中manually create an installable trigger,请执行以下步骤:
示例配置:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。