logo
search
Others

How to Remove Gray Space Below Images in Microsoft Lists Gallery View

Bushra ParveenBushra Parveen Oct 10, 2026 868 views

Question details

The user needs to eliminate the unwanted gray space appearing beneath images in Microsoft Lists gallery view cards.

How to Remove Gray Space Below Images in Microsoft Lists Gallery View
Product
Microsoft Lists
Device & OS
not provided
Scenario
Customizing the layout of a gallery card using SharePoint JSON formatting.
Observed behavior
A gallery card renders an unexpected gray gap between the image and the subsequent text fields, which is not easily resolved with standard style changes.
Before you start

Ensure you have the necessary permissions to edit the view formatting in Microsoft Lists, and copy your original JSON code into a text editor as a backup before making any changes.

Solution 1Recommended

Adjust JSON Formatting for Image Containers

Modify the view formatting JSON to remove fixed heights or unused flexbox spacing that is causing the gray gap.

The gray space usually appears when standard JSON style parameters like height, width, padding, or margins are improperly applied to the image's parent container, leaving unused space in the flexbox layout.

1
Open View Formatting

Navigate to your Microsoft List, click on the current View dropdown menu in the upper right corner, and select 'Format current view'.

2
Access Advanced Mode

At the bottom of the format pane, click on 'Advanced mode' to reveal the raw JSON code for your gallery cards.

3
Inspect the Container Attributes

Locate the 'div' element wrapping your image. Look for any 'height', 'aspect-ratio', or 'padding' properties applied to this container.

4
Modify Layout Styles

Remove unnecessary fixed height values from the container and adjust the image dimensions. Ensure flexbox properties like 'justify-content' or 'align-items' are not forcing the elements to stretch.

5
Preview and Save

Click the 'Preview' button to verify that the gray space below the image has been removed. Once satisfied with the layout, click 'Save'.

Adjust JSON Formatting for Image Containers
Aspect Ratio Check: If the image aspect ratio differs from the container it is placed in, consider adding 'object-fit: cover' to the image style attributes to fill the container evenly.
Free Microsoft Office alternative

Manage Data without Complex Formatting using WPS Office

While customizing Microsoft Lists often requires complex JSON formatting just to fix basic image layouts, WPS Spreadsheet provides an intuitive, lightweight, and completely free alternative. Easily manage your lists, align images perfectly in cells without coding, and enjoy seamless compatibility with Microsoft Excel formats.

  1. 1. Download WPS Office: Visit the official WPS website to download the free office suite for your device.
  2. 2. Install the Application: Run the installer and follow the quick setup instructions to install WPS Spreadsheet.
  3. 3. Import Your Data: Open WPS Spreadsheet and directly import your existing Excel files or CSV lists to start managing data effortlessly.
Easily insert and perfectly align images within data lists without writing JSON code.Fully compatible with Microsoft Excel (.xlsx) formats for seamless file sharing.Lightweight software that launches instantly and runs smoothly on older devices.Familiar, easy-to-use interface with no steep learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Microsoft Lists gallery card have extra space below the image?

Extra space typically appears when the JSON formatting assigns a fixed height or incorrect aspect ratio to the image container. This causes the flexbox layout to fill the remaining area with empty gray space.

Can I use standard CSS properties in Microsoft Lists JSON formatting?

Yes, Microsoft Lists view formatting supports a subset of standard CSS properties under the 'style' attribute. You can use properties like margin, padding, flex, object-fit, and height to control your card layout.

How do I access the advanced JSON editor in Microsoft Lists?

Click on the current view dropdown menu at the top right of your list, select 'Format current view', and then click 'Advanced mode' at the bottom of the formatting pane. This allows you to edit the raw JSON directly.