Example of Compact TablePress Implementation
-
The TablePress documentation assumes a certain level of experience that I apparently don’t have. Can someone just give me an example of the Compact class implementation for my TablePress table?
-
Hi,
thanks for your post, and sorry for the trouble.
I’m not really sure what you mean here. Can you please explain in more detail what you want and example of?
Regards,
TobiasI have a TablePress table on a WordPress page and I want to set the class to “compact” to eliminate much of the white space currently in the table’s output format. I assume that’s the way to do that.
Hi,
yes, if your theme contains CSS that uses a “compact” class, adding it to a table should work.
For that, just addcompactto the “Extra CSS classes” text field on the table’s “Edit” screen.Regards,
TobiasJust enter the word compact in the text box labeled “Extra CSS classes”?
How would I know if my theme uses a compact class?Hi,
yes, just inserting that word there would add it as a CSS class to the table.
You would have to check the theme’s “CSS” code to know. But then again, how did you come up with the idea of this “compact” class? Did you read about it somewhere?
An easier way for reducing the table white-space would be to set the padding to a smaller value using a bit of CSS code. For example, add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:
.tablepress th, .tablepress td { padding: 4px; }Regards,
TobiasA link on the edit page got me here: https://www.datatables.net/examples/styling/compact.html
Thanks for your help.
Hmmm… is there any way to not display a record with a date previous to the current day?
Hi,
ah, thanks for the clarification! This CSS class is only valid in DataTables, but not directly in TablePress. I suggest the CSS that I posted above to reduce the padding in your tables.
For showing only dates from the past, I suggest to take a look at the TablePress Extension that is explained at https://wordpress.org/support/topic/show-only-future-dates?replies=4#post-6080471
Regards,
TobiasThat sounds EXACTLY like what I need, but I don’t know how to install the extension. I tried to upload it like a plug-in, but I get the following message:
The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature
How do I get that php code installed?
Well, good news/bad news: After re-trying I was successful in getting the extension loaded — that’s the good news. The bad news is this new code feels compelled to double-space the lines of text in a cell, and the default font and font color have changed.
My production website is SnakeOilWillie.com. I use FrankDeBonis.com as a test/learning site before rolling changes to production. The table on the home page of frankdebonis.com will show you the double-spaced rows.
I’ll keep muddling along to see if I can fix this, but if you feel compelled to give me a hint, I would certainly appreciate it.
…oh, and the other significant part of the good news is the function is working! No old dates displayed in my table!
I got it. I introduced line-height to the css and that worked. Thanks for all your help Tobias.
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
TobiasP.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!
Hi
I am dummy about CSS.Need to use compact design table. (Especially for magnified first column and top-bottom lines.) https://i.imgur.com/tlF3QaW.png
How it can be used individual tables with in the plugin settings? I write “compact” in table options, it doesn’t work.
https://i.imgur.com/CTv7oK6.png
https://i.imgur.com/iY3vXxB.pngI need basic instructions.
Thanks.Hi,
thanks for your question, and sorry for the trouble.
Adding the
compactclass would only work if your theme has defined it.
Using “Custom CSS” is the better way to go. You might just need a small change, to work around a conflict in your theme. Please try again with.tablepress td, .tablepress th { padding: 4px !important; } .tablepress th { padding-right: 20px !important; }Regards,
TobiasIt seems the code has no function.
Or I do something wrong maybe.please look at the screenshot; https://i.imgur.com/YSYaJDI.png
The topic ‘Example of Compact TablePress Implementation’ is closed to new replies.