[]
        
(Showing Draft Content)

IMAGE

This function input an URL or a base64 string to show an image in cell.

Syntax

IMAGE(source, [alt_text], [sizing], [height], [width], [clipX], [clipY], [clipHeight], [clipWidth], [vAlign], [hAlign])

Note: When exporting to Excel, certain parameters such as clipXclipYclipHeightclipWidthvAlign, and hAlign will be ignored, as these are specific to SpreadJS. For more information, please refer to Image Sparkline.

Arguments

Argument

Description

source

[Required] The URL path, using an "https" protocol, of the image file

alt_text

[Optional] Alternative text that describes the image for accessibility

sizing

[Optional] Specifies the image dimensions

There are several possible values:

0 - Fit the image in the cell and maintain its aspect ratio

1 - Fill the cell with the image and ignore its aspect ratio

2 - Maintain the original image size, which may exceed the cell boundary

3 - Customize the image size by using the height and width arguments

The default value is 0

height

[Optional] The height of the image in pixels

width

[Optional] The width of the image in pixels

clipX

[Optional] The x-axis coordinate of the top left corner of the source image sub-rectangle to draw into the destination context

The default value is 0

clipY

[Optional] The y-axis coordinate of the top left corner of the source image sub-rectangle to draw into the destination context

The default value is 0

clipHeight

[Optional] The height of the source image sub-rectangle to draw into the destination context

The default value is the height of image

clipWidth

[Optional] The width of the source image sub-rectangle to draw into the destination context

The default value is the width of image

vAlign

[Optional] Vertical alignment of the image

0 - Top

1 - Center

2 - Bottom

The default value is 2 (bottom)

hAlign

[Optional] Horizontal alignment of the image

0 - Left

1 - Center

2 - Right

The default value is 0 (left)

Examples

IMAGE("https://upload.wikimedia.org/wikipedia/en/4/41/Flag.svg")