Column Hiding Responsive Table Template

Improve mobile readability by automatically hiding less-critical columns on smaller screens.

This responsive technique uses CSS media queries to create a "less is more" experience on mobile, ensuring the most important data is always visible without horizontal scrolling.

Screenshot of a table that hides certain columns when viewed on a smaller screen.

Get Source Code → Preview →

About this "Column Hiding" Table

Sometimes, not all data is equally important. On a wide desktop screen, it's great to show extra details like "Date Created" or "Internal ID". On a narrow mobile screen, however, these details can often be sacrificed in favor of a clean, scroll-free view of the primary data.

This template achieves this using CSS Media Queries. We define special classes (e.g., .hide-on-mobile) and then, inside a media query that targets screens below a certain width, we set those classes to display: none;. This cleanly removes both the header (th) and all corresponding data cells (td) in that column, creating a more focused table view for mobile users.

Key Features:

Ideal Use Cases:

Code

Here's the full code for the column-hiding table:

View Output