Hi Marc,
thanks for your question.
That space around the images is coming from your theme, but we can easily remove that. Additionally, we shorten and fix your current “Custom CSS” a little bit. Please replace what you have now with this:
.tablepress-id-5 tbody td {
background-color: #ffff00;
text-align: center;
vertical-align: top;
border: none;
width: 25%;
}
.tablepress-id-5 img {
margin: 0 auto -12px;
}
Regards,
Tobias
Thans a lot, it works great!
Another dummy question: my new table got number 12. But I deleted some tables (it was only some tests), and want that my next table is #6. Is it a way to “rest” id numbers of tables?
Thanks again…
Hi,
great to hear that this worked! 🙂
Yes, table IDs are auto incremented, even if tables are deleted. Resetting the counter is possible by diving deeper into some WordPress details, but that’s not too difficult. You still need to be careful:
1. Browse to http://www.judo-vsg-fribourg.ch/wp-admin/options.php
2. On that page, scroll down until you reach the field with the label “tablepress_tables”.
3. In that field, the content will be something like {"last_id":12,"table_post":{...
4. The 12 (or whatever the number is right now) indicates the last table ID that was given to a table. Change that to a 5, but be careful to not accidentally delete or change any of the surrounding characters.
5. The table ID of the next table that is added will then be 6.
Regards,
Tobias
One more time, thanks! Works great…
Let’s go trying to go ahead by myself!
Hi Marc,
sure, no problem! You are very welcome!
Best wishes,
Tobias
Very nice from you!
Last question, about the same page : http://www.judo-vsg-fribourg.ch/technique/nage-waza/
I put now 2 tables. But the best should be only one table, with rows 1-4 in yellow and 5-8 in orange.
I try to make it with 2 tables, but that’s not good. Is it possible to merge the table 5 and 6 and then work with easy and short css code to change the row’s colors?
Maybe easy for you, but still tricky for me…
Okay… I go step by step… Seems to work, but I’m sure my CSS can be optimized… If you got any suggestion, it would be nice!
thanks for your help, again…
Hi Marc,
great that you found a solution already!
In general, your CSS is totally find, but yes, it can be shorted. As a rule of thumb: Whenever the code between the { } is exactly the same for two blocks of CSS, you can simply combine the parts before the { (called “selector”) as a comma-separated list.
In your case, the CSS can be shortened to
.tablepress-id-5 tbody td {
color: #000000;
text-align: center;
vertical-align: top;
border: none;
width: 25%;
}
.tablepress-id-5 img {
margin: 0 auto -12px;
}
.tablepress-id-5 .row-1,
.tablepress-id-5 .row-2,
.tablepress-id-5 .row-3,
.tablepress-id-5 .row-4 {
background-color: #ffff00;
}
.tablepress-id-5 .row-5,
.tablepress-id-5 .row-6,
.tablepress-id-5 .row-7,
.tablepress-id-5 .row-8 {
background-color: #ed7f10;
}
.tablepress-id-5 .row-9,
.tablepress-id-5 .row-10,
.tablepress-id-5 .row-11,
.tablepress-id-5 .row-12 {
background-color: #00ff00;
}
Regards,
Tobias
Cool !
Thanks a lot and have a nice day!
Hi,
absolutely! Have a great day, too!
Best wishes,
Tobias
Good Afternoon Tobias,
I am having a similar issue with my table, I am trying to justify the contact image in the middle of its row/column. I do have a little custom css on it but not much.
Hi,
thanks for your post. To find the exact code to do this, I’d need to take a look at the page with the table. Could you therefore please post a link to the page with the table?
Regards,
Tobias