Hi,
thanks for your post, and sorry for the trouble.
The reason for this is that your table is already too wide for the screen. The browser will therefore not honor this width command, because that would make the table even wider.
However, there’s a trick: You could disallow automatic line breaks in that column, using
.tablepress-id-71 .column-1 {
white-space: nowrap;
}
This way, the cells’ content will be in one line of text (to wrap it, just manually add a line break using “Enter” in the cells).
Regarding the scroll bars: Unfortunately, neither Android nor iOS show scroll bars on mobile phones — unless you are actively scrolling. Unfortunately, I don’t know a way to change that, sorry.
Regards,
Tobias
Thanks works like a charm!
And they’ll find out that horizontal scrollingbars will be nacessary
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!
I’m also having trouble with the column widths on the page at http://dev.cfrrr.org/apply/scholarships/
I’ve tried your solution on the page at https://ww.wp.xz.cn/support/topic/tablepress-column-widths/ with no luck.
Here’s what I tried:
.tablepress thead th,
.tablepress tbody td {
padding: 8px !important;
}
.page-id-226 .tablepress .column-1 {
width: 25%;
}
.page-id-226 .tablepress .column-2 {
width: 75%;
}
Any ideas?
Hi,
thanks for your post, and sorry for the trouble.
Also sorry for the late reply! As I was on holidays, I did not have a chance to look at this earlier.
Please also add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:
.tablepress {
table-layout: normal;
}
Regards,
Tobias
Thanks for the response. I added the table-layout code to the custom css but it didn’t change the column widths.
I also tried table-layout: auto; and table-layout: fixed; with no luck.
Any other ideas?
Hi,
ah, my bad. Please try again with
.tablepress {
table-layout: auto !important;
}
Regards,
Tobias
Boom! that worked. thanks so much!
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!