学AI代码笔记【018】号【嘉年华】


18.2025年08月30日 星期六学AI代码笔记【018】号

主要内容

🔔

行高

GridView.RowHeight

行高 | WPS开放平台

说明

可读写

表格视图的行高,注意:设置值时为以下之一:'Short','Medium','Tall','ExtraTall' .

返回值

String

行高的四个类型

低:'Short'

中:'Medium'

高:'Tall'

超高:'ExtraTall'

批量设置

关键代码

  1. 官方

function main() {
    const gridView = Application.Sheets(1).Views(1);
    console.log(gridView.RowHeight);
    gridView.RowHeight = 'Tall';
}
main();
  1. 第二个中

function main() {
    const gridView = Application.Sheets(1).Views(2);
    console.log(gridView.RowHeight);
    gridView.RowHeight = 'Medium';
}
main();
  1. 批量设置

function main() {
    // 获取工作表中的视图集合
    const views = Application.Sheets(1).Views;
    // 设置视图 1 的行高为"低"
    const view1 = views.Item(1);
    view1.RowHeight = 'Short'; // 低
    // 设置视图 2 的行高为"中"
    const view2 = views.Item(2);
    view2.RowHeight = 'Medium'; // 中
    // 设置视图 3 的行高为"高"
    const view3 = views.Item(3);
    view3.RowHeight = 'Tall'; // 高
    console.log("视图 1 行高已设置为低,视图 2 行高已设置为中,视图 3 行高已设置为高");
}
main();

多维表代码使用案例库

【1】多维表代码使用案例库


湖南省
浏览 104
收藏
1
分享
1 +1
+1
全部评论