Great-looking tables on all devices!

Responsive Tables

Tables on websites can not always adjust to the available space on the screen automatically: Their content requires a certain minimum space, and that defines the minimum width of the table. If that minimum table width is bigger than the width of the available content area or screen, the table will not fit.

Besides the ugly design that this causes, this can actually prevent your visitors from seeming important information in your tables! It’s bad for search engine optimization (SEO) and accessibility as well.

Approaches for responsiveness

The Responsive Tables feature module in TablePress Pro and TablePress Max offers five approaches to solve this challenge:

For all modes, features like searching and pagination will continue to work. Sorting will be possible for all modes except the Stack mode.

Here are examples for the five modes:

Scroll mode

This mode will make a table that is too wide to be fully displayed horizontally scrollable. With that, the user can still reach all table data. This is usually a good approach for tables with images, if they don’t automatically resize.

For the Scroll mode, it is also possible to show left/right arrow buttons on the left and right sides of the table, to indicate that a table can be scrolled horizontally, in addition to swiping.

Using the Fixed Rows and Columns feature module, it is also possible to keep columns fixed to the edge of the screen.

Collapse mode

The Collapse approach can add a hide/expand effect to a table. It will hide the data from those columns that would otherwise be cut-off and instead adds that data to a collapsible row that is inserted below each entry. That row can be shown and hidden with a “+” and “-” button. This mode is especially useful in tables that show additional information for some “main” columns, e.g. in a directory table.

By the way: Changing the colors for the “+” and “-” buttons in the first column is very easy with the Default Style Customizer feature module!

The “Collapse” mode also works well on bigger screens and can be used to make data available that maybe doesn’t have to be visible on first glance, but offers valuable details. For that, it’s also possible to configure which columns are collapsed when the page is loaded. The following demo table is configured to collapse all but four columns:

Last NameFirst NameBirthdayCompanyPhoneZIP codeCountryBalancePointsRating
BanksTravis05/04/1969Apple200-432464655Italy$61.1786.6
CainLawrence05/16/1994IBM701-310898004United States$54.8152.5
MiddletonDennis01/10/1992Google580-950180913Spain$24.8345.2
ValenzuelaLunea01/09/1966Cisco970-865551606Germany$74.0773.7
BurgessQuynn09/24/1988Mozilla430-894378965France$16.1382.9

Similar to the Collapse mode, the Modal mode will only show columns that fit on the screen. The other data is then shown in a modal overlay when a row is clicked.

By the way: Changing the colors for the “+” and “-” buttons in the first column is very easy with the Default Style Customizer feature module!

The “Modal” mode can also be used to make data available in a modal overlay, e.g. details for an table entry. It’s also possible to configure which columns are hidden when the page is loaded. The following demo table is configured show four columns, but will reveal all information after clicking the “+” button:

Last NameFirst NameBirthdayCompanyPhoneZIP codeCountryBalancePointsRating
BanksTravis05/04/1969Apple200-432464655Italy$61.1786.6
CainLawrence05/16/1994IBM701-310898004United States$54.8152.5
MiddletonDennis01/10/1992Google580-950180913Spain$24.8345.2
ValenzuelaLunea01/09/1966Cisco970-865551606Germany$74.0773.7
BurgessQuynn09/24/1988Mozilla430-894378965France$16.1382.9

Stack mode

The Stack mode will show the cells of a row on top of each other, instead of next to each other. This makes the table more narrow, as it will appear to have only two columns: One for the header cells and one for the original row’s data cells.

Flip mode

This mode changes the layout of the table, by flipping it to the side (rows appear as columns and vice versa), and then makes the table horizontally scrollable. This mode is a good solution for plain data tables, but will usually not work nicely in tables with images, cells of different height, or with combined/merged cells.

Usage instructions

To use these features with your tables, activate the “Responsive Tables” feature module on the “Modules” screen of TablePress Pro or TablePress Max. Then, configure the desired options in the “Responsive Tables” section on the table’s “Edit” screen, by choosing the desired more for responsiveness.

For the Flip and Stack modes, you can then also choose the biggest screen size, called breakpoint, for which you want to use the responsiveness mode instead of the original table view. Available breakpoints are Phone, Tablet, Desktop, and All, according to this list:

  • Phone: The Flip or Stack mode is used only on phones (devices with a screen width smaller than 768 pixels).
  • Tablet: The Flip or Stack mode is used on phones and tablets (devices with a screen width smaller than 980 pixels).
  • Desktop: The Flip or Stack mode is used on phones, tablets, and medium-sized monitors (devices with a screen width smaller than 1200 pixels).
  • All: The Flip or Stack mode is used on all screens, regardless of their screen size.

For the Scroll mode, you can also choose whether to show left/right arrow buttons, to indicate that the table can be scrolled horizontally.

Configuration parameters

To configure this module’s features, you can also use these configuration parameters in the “TablePress Table” block, the Elementor widget, or in the Shortcode that you are using to embed the table:

ModuleSlugConfiguration parameterNameDescriptionTypeDefault value
Responsive Tablesresponsive-tablesresponsiveMode for ResponsivenessThe desired behavior of the table on small screens.enum ("" (empty string), scroll, collapsemodal, stack, or flip)"" (empty string)
Responsive Tablesresponsive-tablesresponsive_breakpointBreakpoint for the Mode of ResponsivenessThe largest screen size (breakpoint) for which the Flip or Stack mode should be used.enum (phone, tablet, desktop, or all)phone
Responsive Tablesresponsive-tablesresponsive_scroll_buttonsHorizontal Scroll ButtonsWhether to show left/right buttons for the horizontal scrolling.boolean (true or false)false