[CSS] tableaux

tableaux [CSS] - HTML/CSS - Programmation

Marsh Posté le 19-08-2004 à 15:01:58    

Salut,
j'ai pas mal de page à faire avec des tableaux dedans.
Je voudrais gerer ces tableaux avec les css mais je n'arrive pas a faire ce que je veux.
 
Sachant que mon tableau commençe comme cela:

     <table cellpadding="0" cellspacing="1">
        <tr align="center">  
          <td width="175" background="img/pixel-gris1.gif">&nbsp;</td>


 
Je suis obligé de mettre background="img/pixel-gris1.gif" dans chaque balise td, ce qui est lourd, hyper long et chiant.
 
Comment ecrire ça en css svp?
merci


Message édité par kameha le 19-08-2004 à 15:02:29
Reply

Marsh Posté le 19-08-2004 à 15:01:58   

Reply

Marsh Posté le 19-08-2004 à 15:14:22    

html :

Code :
  1. <table class="avecFond">


 
css :

Code :
  1. table.avecFond td {
  2.    background-image: url(chemin/image.png);
  3. }


Message édité par pierre6020 le 19-08-2004 à 15:15:05
Reply

Marsh Posté le 19-08-2004 à 15:15:34    

Reply

Marsh Posté le 19-08-2004 à 15:22:27    

thx

Reply

Marsh Posté le 19-08-2004 à 15:26:41    

par contre jvais casser les c***lles mais comment faire une ptite variante a l'interieur  et changer la couleur d'une ou deux cellules. Parceque là, ya plus moyen de rien.

Reply

Marsh Posté le 19-08-2004 à 15:30:21    

HTML >
<td class="different">
 
CSS >
td.different {
background-color:#123123;
}

Reply

Marsh Posté le 19-08-2004 à 15:31:53    

Sur les <td> spécifiques :
 

Code :
  1. <td class="specialJeSuisSpecial">


 
css :
 

Code :
  1. td.specialJeSuisSpecial {
  2.    background-color: #cccccc;
  3. }

Reply

Marsh Posté le 19-08-2004 à 15:32:17    

arf doublé ;)

Reply

Marsh Posté le 19-08-2004 à 15:44:54    

donc :
CSS

table.fond1 td {  
    background-image: url(../img/pixel-gris2.gif);  
}
td.fond2 {  
    background-image: url(../img/pixel-gris1.gif);  
}


 
HTML

<table cellpadding="2" cellspacing="1" class="fond1">
        <tr align="center">  
          <td class="fond2">&nbsp;</td>


 
fond2 morche pas.

Reply

Marsh Posté le 19-08-2004 à 15:46:59    

pourquoi table.fond1 td
?


Message édité par masklinn le 19-08-2004 à 15:48:44

---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 19-08-2004 à 15:46:59   

Reply

Marsh Posté le 19-08-2004 à 15:48:40    

bah il existe bien non?

td.fond2 {  
    background-image: url(../img/pixel-gris1.gif);  
}

Reply

Marsh Posté le 19-08-2004 à 15:49:09    

Ca m'a pourtant l'air correct.

Reply

Marsh Posté le 19-08-2004 à 15:49:29    

kameha a écrit :

bah il existe bien non?

td.fond2 {  
    background-image: url(../img/pixel-gris1.gif);  
}



oui, mais ca ne s'était pas affiché la première fois (me demande pas pourquoi), j'avais que fond1 [:totoz]


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 19-08-2004 à 15:50:06    

Masklinn a écrit :

pourquoi table.fond1 td
?


 
tous les td qui sont dans <table class="fond1">

Reply

Marsh Posté le 19-08-2004 à 15:50:22    

en meme tps c'est normal, fond1(attribué à table) l'emporte sur fond2 (attribué à td)  
??

Reply

Marsh Posté le 19-08-2004 à 15:51:04    

bah non c'est l'inverse???

Reply

Marsh Posté le 19-08-2004 à 15:53:38    

oui mais dans mon html.
"class fond1" est attribué à table qui lui contient une balise td dans laquelle je met "class fond2".
C'est normal qu'il le calcul pas non?

Reply

Marsh Posté le 19-08-2004 à 15:58:48    

.fond1 td est attribué aux td de la table,
mais si tu mets un .fond2 dessus ca doit l'emporter normallement.
Un lien?

Reply

Marsh Posté le 19-08-2004 à 16:00:44    

il s'agit des 2 premieres lignes pour class=fond2


Message édité par kameha le 20-08-2004 à 09:22:27
Reply

Marsh Posté le 19-08-2004 à 16:04:11    

ton image, c'est un pixel répété?
dans ce cas-là, tu as background-color: #cccccc

Reply

Marsh Posté le 19-08-2004 à 16:05:46    

tiens et tout rentre dans l'ordre

Reply

Marsh Posté le 19-08-2004 à 16:06:36    

on peut pas mettre 2 fois 1 pixel qui se repete donc :pt1cable:

Reply

Marsh Posté le    

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed