Résolu Aide pour table

Ʀagnar

Goodbye my friend
Premium
Inscription
29 Août 2014
Messages
513
Réactions
147
Points
4 046
Bonjour, j'ai actuellement mis une table css sur mon site pour le classement et j'aimerai qu'un coup sur deux la ligne sois légèrement plus foncée et je ne sais pas comment m'y prendre pourriez vous m'éclairer s'il vous plaît ?

Merci d'avance :)
 

Ʀagnar

Goodbye my friend
Premium
Inscription
29 Août 2014
Messages
513
Réactions
147
Points
4 046
J'ai déjà un bout de code comme ceci :

PHP:
table tr td {
    padding:8px;
    border-top: 1px solid #ffffff;
    border-bottom:1px solid #e0e0e0;
    border-left: 1px solid #e0e0e0;
  
    background: #fafafa;
    background: -webkit-gradient(linear, left top, left bottom, from(#fbfbfb), to(#fafafa));
    background: -moz-linear-gradient(top,  #fbfbfb,  #fafafa);
}
table tr.even td{
    background: #f6f6f6;
    background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f6f6f6));
    background: -moz-linear-gradient(top,  #f8f8f8,  #f6f6f6);
}
Mais le problème c'est que j'aimerai faire quand dans mon code php une fois sur deux sa fasse le even et je n'y arrive pas :/
 

ॐ Devkush ॐ

Premium
Inscription
30 Octobre 2015
Messages
588
Réactions
219
Points
2 176
J'ai déjà un bout de code comme ceci :

PHP:
table tr td {
    padding:8px;
    border-top: 1px solid #ffffff;
    border-bottom:1px solid #e0e0e0;
    border-left: 1px solid #e0e0e0;
 
    background: #fafafa;
    background: -webkit-gradient(linear, left top, left bottom, from(#fbfbfb), to(#fafafa));
    background: -moz-linear-gradient(top,  #fbfbfb,  #fafafa);
}
table tr.even td{
    background: #f6f6f6;
    background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f6f6f6));
    background: -moz-linear-gradient(top,  #f8f8f8,  #f6f6f6);
}
Mais le problème c'est que j'aimerai faire quand dans mon code php une fois sur deux sa fasse le even et je n'y arrive pas :/
ces pour sa qu'il faux utiliser le nth-child(odd) ;) tous tes impert seront de la couleur que tu lui a mis ;)
 
Cette réponse a aidé l'auteur de cette discussion !
Haut