Table exceeding max width
-
First of all, I just want to thank you for a brilliant plugin. Does its job incredibly well and has more features than I could possibly think of for working with tables.
Now to my problem. Some of the tables I created contains quite a lot of information and I haven’t found a good way to reduce it. This means that the columns exceed the max-width I have set on the table in total and makes it stick out over the area it’s supposed to be on.
I’ve been looking at different ways to solve it with CSS somehow and found that it kind of helps by setting
table-layout: fixed. However, instead of the table itself being too wide, the content in each cell flows over into the other cells. Hiding the overflow won’t help either and I haven’t found a way to make the words wrap properly to make that solution work. It also seems to mess up the design of some of my other tables.Now, my thought was that a possible solution would be to wrap the whole table in a div, let the table be as wide as it wants and instead set the overflow to allow for horizontal scrolling within that div. It’s quite a makeshift solution, but would work for the site I’m working on.
This in itself shouldn’t be hard for me to implement myself if it were only one or a few tables, but the website I’m working on is containing a fairly big amount of tables and it’s just too much work to do manually.
Unless you know of another, simpler solution to my problem, would it be fair to ask if you could add an option in the plugin settings to wrap the tables in a div with a
.tablepress-wrapperclass or something similar? I’m sure this could be useful for other purposes too.One benefit I can thing of if doing this would be to make it a lot easier to style the position of the whole table (including description text and title) in relation to the rest of the page content without having to manually edit margins for both header, description and the table itself.
Before I make my own plugin to wrap the tables created by Tablepress, I thought I would simply ask you about it. Perhaps there are downsides to this method that I haven’t thought about, but that’s also why I want it to be an option so it doesn’t accidentally mess up the design of other people’s tables.
I realize I wrote more than I had first intended, so thanks for reading and keep up the good work on the plugin!
Regards,
Patrik
The topic ‘Table exceeding max width’ is closed to new replies.