• Resolved Almiro Cunha

    (@almirocunha)


    In the table league of this link, i want a diferent collor for all line in the position 1 and another color for the positions number 17th to 20th, but the color and the lines to be painted depends on the championship.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Roch

    (@rochesterj)

    Olá @almirocunha

    Thanks for reaching out!

    This code may not work so nice in your case as you have a paginated table. You’ll need to use a single table for that

    Add the following code in your custom css field ( Wp admin > SportsPress > Settings > General > Custom CSS ) and let us know how it works:

    .sp-league-table tbody tr:nth-child(1) {
    	background: red;
    }
    .sp-league-table tbody tr:nth-last-child(1) {
    	background: red;
    }
    .sp-league-table tbody tr:nth-last-child(2) {
    	background: red;
    }
    .sp-league-table tbody tr:nth-last-child(3) {
    	background: red;
    }
    .sp-league-table tbody tr:nth-last-child(4) {
    	background: red;
    }

    Thanks!

    Thread Starter Almiro Cunha

    (@almirocunha)

    But, the position who i want to chance color depends on the championship

    Thread Starter Almiro Cunha

    (@almirocunha)

    change*

    Roch

    (@rochesterj)

    Hi!

    For some competitions, it isn’t the last 4 and the first?

    We can target specific pages if you want as well.

    Thanks!

    Kind Regards,
    -Roch

    Thread Starter Almiro Cunha

    (@almirocunha)

    In some competitions we have do change color from the 2th to the 4th position, in another, we have to change color from the 1st to 4th, like i said, it depends.

    Roch

    (@rochesterj)

    Hi!

    Thanks for your reply.

    We’ll need links to each of these so we can provide you the correct CSS code.

    Thanks!

    Thread Starter Almiro Cunha

    (@almirocunha)

    1 – https://adorofutebol.com.br/brasileiro-serie-b-2017/
    In this league we have different colors in:
    1th, 2th to 4th, 5th to 16th (default color), 17th to 20th

    2 – https://adorofutebol.com.br/brasileiro-serie-a-2017/
    In this league we have different colors in:
    1th, 2th to 5th, 6th to 12th, 13th to 16th (default color), 17th to 20th

    3 – https://adorofutebol.com.br/copa-do-nordeste-2017/
    In this league we have different colors in:
    1th to 2th, 3th to 4th (default color)

    and there are many others combinations

    Thanks

    Roch

    (@rochesterj)

    Hi!

    Thanks for your reply.

    Please keep in mind that you need to remove the pagination of your table, otherwise it won’t work.

    Add the following code in your custom css field ( Wp admin > SportsPress > Settings > General > Custom CSS ) and let us know how it works:
    Regarding 1st link:

    .post-27614 .sp-league-table tbody tr:nth-child(1) {
    	background: red;
    }
    .post-27614 .sp-league-table tbody tr:nth-child(2) {
    	background: red;
    }
    .post-27614 .sp-league-table tbody tr:nth-child(3) {
    	background: red;
    }
    .post-27614 .sp-league-table tbody tr:nth-child(4) {
    	background: red;
    }
    .post-27614 .sp-league-table tbody tr:nth-child(17) {
    	background: red;
    }
    .post-27614 .sp-league-table tbody tr:nth-child(18) {
    	background: red;
    }
    .post-27614 .sp-league-table tbody tr:nth-child(19) {
    	background: red;
    }
    .post-27614 .sp-league-table tbody tr:nth-child(20) {
    	background: red;
    }

    2nd link:

    .post-24461 .sp-league-table tbody tr:nth-child(1) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(2) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(3) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(4) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(5) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(6) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(7) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(8) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(9) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(10) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(11) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(12) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(17) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(18) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(19) {
    	background: red;
    }
    .post-24461 .sp-league-table tbody tr:nth-child(20) {
    	background: red;
    }

    3rd link:

    .post-24228 .sp-league-table tbody tr:nth-child(1) {
    	background: red;
    }
    .post-24228 .sp-league-table tbody tr:nth-child(2) {
    	background: red;
    }
    .post-24228 .sp-league-table tbody tr:nth-child(3) {
    	background: red;
    }
    .post-24228 .sp-league-table tbody tr:nth-child(4) {
    	background: red;
    }

    So overall the rule is using the post ID, then copy and paste the code for each of the rows you want to change.

    Thanks!

    Thread Starter Almiro Cunha

    (@almirocunha)

    Its wonderfull, thank you very much.

    Roch

    (@rochesterj)

    You’re most welcome!

    Let us know if you need anything else.

    Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Color in Table League for position and championship’ is closed to new replies.