add colour in table
-
Hi all
I want to know if is possible to colours the number position of table https://www.betisweb.com/web/table/tabla-temp-2019-2020/
enclosed sample of table https://i.gyazo.com/8e44def129427e5018cd1ed9e86a3223.png
thks you
-
Hi!
Thanks for reaching out, it’s always good to see you here.
Sure, that’s possible. What would the rule for your coloring codes be?
Do you have a specific pattern that you want to follow?
Thanks!
enclosed sample of table https://i.gyazo.com/8e44def129427e5018cd1ed9e86a3223.png
and add https://i.gyazo.com/bc954c6215bb145a679ebc29b3a6cdad.png background en verde #008000
letras en blancoHi!
Thanks for your reply.
Alright, let me give you some pointers and how to adjust this for your desired style.
.sp-data-table tr:nth-child(1) .data-rank { background: #f00; color: #ffffff !important; }
You can copy and paste this code, just replace 1 with the rank you want to change (so 1-4 is that yellow, 5 and 6 gray).
Then use this for the last few:
.sp-data-table tr:nth-last-child(1) .data-rank { background: #f00; color: #ffffff !important; }
This changes the very last item, Copy and paste this code to change the 2nd and 3rd from bottom up.
Thanks!
@rochesterj thks will invetigate and will revert
meantime, we have 4 diferents tables
https://www.betisweb.com/web/table/tabla-temp-2019-2020/
https://www.betisweb.com/web/table/tabla-liga-iberdrola/
https://www.betisweb.com/web/table/tabla-tercera-division/
https://www.betisweb.com/web/table/tabla-tercera-division/
above code gaves us will be the same for each table or must be a new one per table??
thks
As someone who is not employed by ThemeBoy, I will expand on the comment from @rochesterj from this thread :
https://www.ads-software.com/support/topic/stars-in-the-same-level/#post-12657373
I’ll give my opinion.
You’re asking a lot from ThemeBoy support to continue to come back into the forum to provide support for your specific problem or issue – the star alignment is a good example of a customization for your case. I’m positive that you have enough feedback, and enough data from all the questions in order to be able to implement your requests. With any software, you do not want to implement updates or changes that simply benefit just one user, it should be a community effort for something the benefits the entire community. Just a heads up of my opinion.That said, re: your comment above, I sent you a screenshot in another thread that outlines how to get the table ID, and then you can wrap the row classes within that table ID so they are targeted, instead of applying to all tables.
You’ll need to get a method to assign unique tables IDs for each table.
Or you can target the page as suggested by @rochesterj here :
https://www.ads-software.com/support/topic/changing-colour-of-bottom-3-rows-in-a-league-table/page/3/#post-12657242I think you’re request is a good idea. I think it would be a good idea to be able to highlight rows based on the position within the table. So thinking of the community you can make this suggestion on the ideas board and try to get support for it, or, better still implement code back to the code repository for review and perhaps it make it into a release everyone can use :
https://sportspress.uservoice.com/forums/285525-ideaboard
https://github.com/ThemeBoy/SportsPressJust my 2 cents!
@corrinarusso surpraised wiht your comment, looking a litle be angry
If I bother here, let me know and I’ll gopls note my last message to @rochesterj “Sorry, I dont know what is max that you can support, I will ask for questions if you can help ok if not, thks anyhow
thks for your job”
IM new of world of wordpress and learning so much in this forum…
end of this post, thks you
Hi @betisweb !
I’ll ask you not to take it as angry.
That is not my intent.
Ask your questions, and learn from the answers is a great approach.
OpenSource software is about community and sharing ideas and information. And I agree, that your idea brings value.
I’m simply trying to scope this idea from a community perspective. Thinking of ways it could be implemented for everyone.And again to be clear, I’m simply a user of this great product exactly as you are.
??
@rochesterj is the one who rules the forum!@betisweb
To answer your question – you can use the unique body ID from the post for each table, in each page.This is untested, but it will be something like this :
https://www.betisweb.com/web/table/tabla-temp-2019-2020/
body.postid-5996, table#DataTables_Table_0 .sp-data-table tr:nth-child(1) .data-rank { { background: #f00; color: #ffffff !important; }
https://www.betisweb.com/web/table/tabla-liga-iberdrola/
body.postid-36785, table#DataTables_Table_0 .sp-data-table tr:nth-child(1) .data-rank { { background: #f00; color: #ffffff !important; }
https://www.betisweb.com/web/table/tabla-tercera-division/
body.postid-37198, table#DataTables_Table_0 .sp-data-table tr:nth-child(1) .data-rank { { background: #f00; color: #ffffff !important; }
There are also plugins available to insert CSS into a single page or post :
https://en-ca.www.ads-software.com/plugins/wp-add-custom-css/thks you @corrinarusso will try to do
Each page on your site has a unique page number called a postid that you can use to target particular CSS in that page.
Here is how to find your PostID per page :
https://artisanthemes.io/find-page-id-wordpress/@corrinarusso thks again
Hey @betisweb
Do you still need any help on this one?
If you need anything else just drop us a line.
Thanks!
Awesome!
thanks.
- The topic ‘add colour in table’ is closed to new replies.