我有一个脚本用于以前的电子表格,该表格向表格添加一行并保留格式。我试图在另一张表上使用此脚本来执行相同的操作。问题是该行被添加到页面底部的错误位置。我该怎么做才能调整新行的添加位置?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.cgi.MainActivity">
<WebView
android:id="@+id/wview_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintLeft_toLeftOf="parent"
tools:layout_editor_absoluteY="8dp" />
</RelativeLayout>
答案 0 :(得分:3)
以下是一些例子:
var ss = SpreadsheetApp.getActive();
function onOpen() {
var menu = [{name:"Add New Last Row", functionName:"addFirstRow"}];
ss.addMenu("Extra", menu);
}
function addFirstRow() {
var sheet = ss.getActiveSheet();
sheet.appendRow(['This row']);
// Insert one empty row after the last row in the active sheet.
sheet.insertRowsAfter(sheet.getMaxRows(), 1);
sheet.appendRow(['That Row']);
// Shifts all rows down by one
sheet.insertRows(1);
// inserts a row at row 10
sheet.insertRows(10);
}