Hi,
thanks for your post, and sorry for the trouble.
First of all, we can greatly shorten your “Custom CSS” to this:
.tablepress tbody td {
vertical-align: middle;
}
.tablepress-id-186 thead th,
.tablepress-id-186 tfoot th {
background-color: #0077D4;
color: #ffffff;
font-size: 12px;
}
.tablepress-id-186 tbody td {
border: 1px solid #0077D4;
font-family: Tahoma;
font-size: 12px;
color: #000000;
}
.tablepress-id-186 thead th,
.tablepress-id-186 tbody td {
padding: 2px;
text-align: center;
}
That should already make things much easier.
Then, if all those tables have the same structure, I suggest to take a look at the “Extra CSS classes” feature of TablePress, which you can imagine like a table group name. For an example of that, please see https://wordpress.org/support/topic/extra-css-classes?replies=6
Regards,
Tobias
Thanks Tobias. I have a quick follow up to the “Extra CSS Classes” function of tablepress because I have yet to use it. How would I name a style series for multiple tables.
I copied the code from the previous example but I don’t know how to manipulate it to incorporate my styling from above.
.tablepress-my-custom-font-size th,
.tablepress-my-custom-font-size td {
font-size: 15px;
}
I want to name it .tablepress-portal. I think I would save it in the plug-in options and then I’m not sure what code to copy to each table. I hope this makes sense. I’m a little confused myself. Thanks!
Hi,
if you want to use tablepress-portal
, then you would paste that into the “Extra CSS classes” field for each tables that shall belong to this group.
In the “Custom CSS”, you would then use the CSS classes .tablepress-portal
in all places where you are currently using a table-ID-based selector (like .tablepress-id-123
).
Regards,
Tobias
That’s awesome! thanks for you help Tobias. I haven’t used the Extra CSS function yet, but I can guarantee that is has been added to my tablepress arsenal! Thanks
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias