How to Hide Blank Rows and Customize Product Comparison Grids in Shopify Enterprise Theme
Running into quirky little layout issues on your Shopify storefront can be a real headache, especially when you are trying to make product pages look sleek and professional. Recently, a store owner named Nick ran into a common issue while setting up the Enterprise theme. Specifically, his product comparison grid was displaying annoying blank rows for specifications that didn't apply to every item, cluttering up the page.
If you have ever stared at your product specs wondering why empty spaces or stray dashes are hanging around, you are definitely not alone. Thankfully, the Shopify community is always quick to step in with smart workarounds. Let's dive into how fellow merchants and experts broke down this problem and solved it step by step using a clever mix of Liquid, JavaScript, and CSS.
Understanding How the Enterprise Theme Handles Comparison Grids
Before jumping straight into the code, it helps to understand what is actually happening under the hood. As community expert Jiseong pointed out in the discussion, the Enterprise theme's comparison grid typically generates a row for every single metafield linked in your list, even if the value comes back completely empty or contains just a stray space.
If a row is totally blank across every single product in your comparison set, you can easily target it using empty cell selectors. However, if a row contains data for some products while sitting empty on others, it is usually best practice to keep the row and display an em dash instead. But if you want those completely empty rows gone for good, you'll need a lightweight script to sweep through the DOM and clean things up.
Step-by-Step Guide to Hiding Blank Rows
If you want to clear out those empty specification rows on your own store using the Enterprise theme, another helpful community member, PinFlow, shared an exact walkthrough that gets the job done cleanly.
First, let's look at how to add the script to your theme editor:
- From your Shopify admin, open Online Store and then click Themes.
- Find your active Enterprise theme and click Edit theme.
- At the top of the editor, open the page menu, select Products, and pick any product page.
- In the left sidebar under the Template list, click Add section at the bottom.
- Choose Custom HTML/Liquid from the list of options.
- Clear out any default text in the Custom code box and paste the following snippet:





- Click Save in the top right corner.

Once you save and refresh your live preview, any completely empty specification rows will automatically vanish from the grid, leaving a much cleaner presentation for your shoppers.
Bonus Customization: Styling Your Specifications List
After getting the blank rows hidden, Nick followed up with another great question: is it possible to remove those harsh dividing lines in the collapsible specifications section and swap them out for alternating background colors instead?
PinFlow came through once again by providing a quick CSS tweak that you can drop right into the exact same Custom HTML/Liquid section you just created. Just open your custom block, press enter right after your script tag, and paste this styling snippet:

You can easily tweak the hex code
It's amazing what a few lines of CSS and JavaScript can accomplish when building out a high-converting ecommerce experience. Whether you're fine-tuning custom liquid blocks or exploring new ways to optimize your store workflow, tapping into community insights makes theme customization feel a whole lot less intimidating.