Horizontal scroll on tables

Posted in: Newspaper
Post count: 201

Hi,

We frequently use tables and they display really poorly on mobile, where the table automatically scales to the available width.

I believe this to be a relatively new behaviour as I recall tables previously having the option to scroll horizontally.

Is there a way to get that horizontal scrollbar back? Even better would be a table that sticks both the header and first column, but I don’t want to have to install third-party plugins.

Thanks!

Post count: 35449

Hello,
Until no we didn’t made any changed for the table layout in our theme, but it is possible to be done in latest WordPress updates. What I can do is to provide for you a custom css that will make the tables to have that horizontal scrollbar, the code would work similar with the one from here – https://www.w3schools.com/howto/howto_css_table_responsive.asp but I will need a link to your website where I can inspect the tables and make the code to apply on them.
Thank you!

Post count: 201

Hi Calin,

That would be most helpful. Here’s a link to an example table: http://tinyurl.com/26eaa32c

Thanks!

Post count: 35449

Hi,
Please try this custom css:
.single table {
min-width: 640px;
}

This css needs to be set in the theme panel > custom code> advance css > phone – https://i.imgur.com/vuGJKr1.png
I hope this will help you!

Post count: 201

Hi Calin,

That works a treat, thank you!

I’m guessing it’s not possible to stick the header and first column without a plugin?

Post count: 35449

Hi,
I think that it can be done with an advance css or using js something like in this example – https://www.w3schools.com/howto/howto_js_sticky_header.asp
Thank you!

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.