Windows 10 Google 表格
我有一张工作表,它根据我在父单元格中放入的超链接自动将图像放入单元格中。
基本上,单元格 E14、G14、I14 和 K14 都使用公式 =iferror(arrayformula(image(number)),"")
数字等于带有链接的单元格,因此 G7、H7、I7、J7。
这一切都很好,但我遇到的问题是图像太小、太宽、太高或太大。
我想知道是否有一种方法可以在将图像放入单元格时自动调整图像大小。
如果您查看下面的图片,您可以看到图像的白色边缘,表明它们不适合列宽和行高。
它应该看起来像这样。
有办法做到这一点吗?如果有必要的话,我愿意编写一个脚本。如有任何建议,我们将不胜感激!
最佳答案
尝试IMAGE(url,2)
来自https://support.google.com/docs/answer/3093333?hl=en
mode - [ OPTIONAL - 1 by default ] - The sizing mode for the image
1 resizes the image to fit inside the cell, maintaining aspect ratio.
2 stretches or compresses the image to fit inside the cell, ignoring aspect ratio.
3 leaves the image at original size, which may cause cropping.
4 allows the specification of a custom size.
请注意,没有模式会导致单元格大小调整以适合图像。
关于google-apps-script - 如何自动调整图像大小以适合 Google 表格中的单元格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64850275/