A Shopify store owner using the Ritual 3.2.1 theme has a table copied from Excel that displays correctly on desktop but overflows horizontally on mobile. They want all spreadsheet information visible without changing the page template or hiding columns.
Initial advice was to wrap the table in an overflow-x: auto container, but the owner said the table was already horizontally scrollable and still required scrolling to see the last columns.
Later replies clarified that the issue is caused by fixed table sizing and Excel-added widths. Suggested fixes focus on mobile-only CSS: reduce font size and padding, allow column widths to auto-adjust, enable wrapping, and optionally apply the CSS only to this page via a custom fit-table class.
Another proposed solution applies similar CSS globally to rich-text tables (.rte table) through Theme settings > Custom CSS, with screenshots showing before/after results. No final confirmation from the owner is included, so the issue remains unresolved in the thread.
I have this spreadsheet that I copied and pasted from an excel. It is overflowing to the right side of the edge on mobile. It looks ok on desktop. Is there any way to fix it? I do not wish to hide any of the information in the spreadsheet. Possibly can make the character size a bit smaller so they can all fit into the mobile width? I also do not wish to change the template of page in theme editor as other pages will use the template.
Hi @itslaura123 Welcome To Shopify Community So An Excel-pasted table won’t respond to mobile automatically since it’s just a fixed HTML table without responsive CSS applied. Without touching the page template, you can wrap the table in a scrollable container using an HTML block instead of the rich text editor — go to the page’s content, switch to “Show HTML” (the < > icon in the editor toolbar), wrap your existing table in a div like this:
<div style="overflow-x: auto; -webkit-overflow-scrolling: touch;">
<table>
<!-- your existing table content stays exactly as is -->
</table>
</div>
This makes the table horizontally scrollable on mobile instead of overflowing off-screen, and every column stays fully visible and readable, no data hidden and no font shrinking needed. It won’t affect any other pages since it’s scoped to this one page’s content, not the theme template. please do not forget to like and mark it solution
Hi there, thanks for the reply. The table was scrollable (from left side to right side) previously. I added the div but nothing changed. Still two columns are invisible on mobile, and require scrolling to the right side to view.
The wrapper didn’t change anything because Ritual already puts tables inside a sideways-scrolling box. That’s the scrolling you had before. To get every column to fit on a phone, the table itself has to be allowed to shrink: smaller text, less padding, and no fixed column widths (Excel adds those when you paste).
This only affects this one page, and the template stays as it is:
Open the page, click the < > (Show HTML) button, and change the opening tag of the div you added to:
<div class="fit-table">
Keep the closing </div> right after </table>, then save.
Go to Online Store > Themes > Customize > Theme settings (gear icon) > Custom CSS, paste this and save:
The last line turns off the all-caps header on mobile, which is a big part of why “Shifter Compatible Adapter Size” is so wide. Desktop doesn’t change, and pages without the fit-table div aren’t affected.
With 5 columns on a small phone, 12px is about as big as the text can be and still fit. If it’s still tight, try 11px or shorten that last header to “Adapter Size”. If the class disappears from the HTML after you save, let me know and I’ll give you a version that doesn’t need it.