Bonjour,

Je ne sais pas trop si je suis dans le bon forum car je crée mon tableau en php.

Bref, je génère un tableau de 9 colonnes et j'en cache une partie.
J'affiche une colonne qui, lorsque l'on va clicker dessus, va faire afficher les autres colonnes.
==> Jusque là tout marche.

Sauf que les cellules qui s'affichent décalées par rapport à la 1ere lignes d'entête...

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<title>Pronostics FOOT</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<style type="text/css">    
         A {
            COLOR: #7070a0; TEXT-DECORATION: none
        }
        A:hover {
            TEXT-DECORATION: underline
        }
        A.externLink {
            PADDING-RIGHT: 11px; BACKGROUND: url(../images/linkExt.png) no-repeat right 50%
        }
        IMG {
            BORDER-RIGHT: transparent 0px; PADDING-RIGHT: 0px; BORDER-TOP: transparent 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; BORDER-LEFT: transparent 0px; PADDING-TOP: 0px; BORDER-BOTTOM: transparent 0px
        }
        IMG.entete {
            BORDER-RIGHT: #555555 0px solid; BORDER-TOP: #555555 0px solid; MARGIN: 0px 1px; BORDER-LEFT: #555555 0px solid; BORDER-BOTTOM: #555555 0px solid
        }
 
        TABLE.tableau {            
            BORDER-COLLAPSE: collapse
        }
        TH.tableau {    PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; VERTICAL-ALIGN: top; PADDING-TOP: 0px; BACKGROUND-COLOR: #CCC6AD; TEXT-ALIGN: left
        }
        TD.tableauM {
            BACKGROUND-COLOR:#f0f0f0 ;
        }
        TD.tableauS {
            BACKGROUND-COLOR:#F9F57E ;
        }
 
		.asep {
			background: url('horizontalsprite.png') -222px 0 repeat-y;
			padding: 0;
			min-width: 36px;
			width: 36px;
			cursor: pointer;
			vertical-align: top;
		}
    </style>
 
	<script type="text/javascript">
			//<![CDATA[
			function Expand()
			{			
				//alert('Expand');
				var myObjP = document.getElementById("cacheP0");
				var p=0;
 
				while(myObjP !=  null)
				{
					myObjP.style.display="inline-block"; // affiche participant cache
					p++;
					var myObjP = document.getElementById("cacheP"+p);
				}
				//alert(p+ ' participants');
 
				var myObjS = document.getElementById("cacheS0");
				var i=0;				
				while(myObjS !=  null)
				{
					myObjS.style.display="inline-block"; // affiche cellules cache
					i++;
					var myObjS = document.getElementById("cacheS"+i);
				}
				//alert(i+ ' cellules');
 
				var accordeonP = document.getElementById("accordeonP");
				accordeonP.style.display="none"; // affiche participant cache
 
				var accordeonS = document.getElementById("accordeonS0");
				var a=0;
				while(accordeonS !=  null)
				{
					accordeonS.style.display="none"; // affiche pronos cache					
					a++;
					var accordeonS = document.getElementById("accordeonS"+a);
				}
				//alert(a+ ' pronos');
				//alert((a*p)+ ' cellules');
			}
			//]]>
	</script>
</head>
<body>
	<div class="contenu">
<?php
$user= Array(   0 =>'Joueur 1' ,
                                1 =>'Joueur 2' ,
                                2 =>'Joueur 3' ,
                                3 =>'Joueur 4' ,
                                4 =>'Joueur 5' ,
                                5 =>'Joueur 6' ,
                                6 =>'Joueur 7');
 
//var_dump($user);
$NbUsr=count($user);
$nbMaxUsr=3;
?>
	<table class="tableau poll" border="1px;">
		<tr>
			<th class="tableau" NoWrap>Rencontre : 27/04/2013</th>
			<th class="tableau" NoWrap>Score Final</th>
<?php           
                        if($NbUsr>$nbMaxUsr) 
                        {
?>
				<th class="asep" id="accordeonP" onclick="Expand();"></th>
<?php                   
                        }
 
                        for($z=0;$z<$NbUsr;$z++)
                        {
?>
				<th class="tableau" <?php if(($z+1)<>$NbUsr && $NbUsr>$nbMaxUsr) echo 'style="display:none" id="cacheP'.$z.'"'; ?> ><?php echo $user[$z];?></th>
<?php
                        }
?>
		</tr>
 
<?php
$lettre='a';
$NbCelluleCachee=0;
                for($a=0;$a<$NbUsr;$a++)
                {
?>
		<tr>
			<td class="tableauM" NoWrap ><?php echo ($lettre++); ?></td>
			<td class="tableauM" align="center"> 5 - 5 </td>
<?php
                        if($NbUsr>$nbMaxUsr) 
                        {
?>
				<th class="asep" id="accordeonS<?php echo $a;?>" onclick="Expand();" ></th>
<?php                   
                        }
 
                        for($b=0;$b<$NbUsr;$b++)
                        {
?>		
				<td class="tableauM" align="center" <?php if(($b+1)<>$NbUsr && $NbUsr>$nbMaxUsr) echo 'style="display:none" id="cacheS'.$NbCelluleCachee.'"'; ?> >
					<?php echo ($b+1).'<>'.$NbUsr /*$user[$b]*/; ?>
				</td>
<?php
                                if(($b+1)<>$NbUsr && $NbUsr>$nbMaxUsr) $NbCelluleCachee++;
                        }
?>
		</tr>
<?php                   
                }
?>
	</table>
	</div>
</body>
</html>
Merci pour votre aide