简体   繁体   English

如何在Google Apps脚本中设置表格宽度

[英]How to set table width in Google Apps Script

When a table is created in a Google Docs file, it is full width, stretching from one margin to another. 在Google文档文件中创建表格时,它是全宽的,从一个边距延伸到另一个边距。 I have created some tables, then amended the margins and created a few more. 我创建了一些表格,然后修改了边距并创建了一些表格。 That has left me with tables of differing widths. 这给我留下了不同宽度的桌子。

I could re-size them individually, but that would be a pain. 我可以单独调整它们的大小,但那会很痛苦。 Is there a way to set a table's width (or all tables) to 100% of the space between the margins with a script? 有没有办法用脚本将表的宽度(或所有表)设置为边距之间的100%空间? I can't find an object for tablewidth, there's plenty of info on columnwidth, but that's not the approach I wish to take. 我找不到tablewidth的对象,有很多关于columnwidth的信息,但这不是我想采取的方法。

I have read the post Google Apps Script - Chart Service: table size, column format but, again, that's not what I am trying to do. 我已经阅读过帖子Google Apps脚本 - 图表服务:表格大小,列格式,但同样,这不是我想要做的。

Can anyone help, please? 有人可以帮忙吗?

GAS does have access to the 'Table' object. GAS可以访问“Table”对象。 GAS-tablewidth GAS-tablewidth

You can set the width of individual columns, not the table as a whole. 您可以设置各列的宽度,而不是整个表格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM