Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > CSS
CSS Forum d'entraide sur l'utilisation des feuilles de style CSS. Avant de poster : Cours CSS, FAQ CSS, Galerie CSS
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 25/03/2011, 10h49   #1
Invité de passage
 
Inscription : mars 2010
Messages : 46
Détails du profil
Informations forums :
Inscription : mars 2010
Messages : 46
Points : 4
Points : 4
Par défaut Taille de cellule dans un tableau

Bonjour,

Je poste car J'ai un problème que je trouve étrange, peut-être que vous saurez pourquoi ?
Je pense que le problème est lié au css. Puisque j'essaie d'aligner les colonnes du corps avec la partie du haut mais je n'y arrive. Bien que le haut et le corps aient les cellules de même taille (soit 12px).
Voici le résultat que j'ai (voir image).

j'ai beau essayer de modifier les valeurs de la taille des cellules, j'ai l'impression que le navigateur ne les lis pas.

Voici mon code, tout d'abord le css :

Code :
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
 
body { 
         background-color: #FFFFFF; 
            color: #565C5E; 
            font-family: verdana,sans-serif; 
            font-size: 10px; 
            line-height: 1.35em; 
            margin: 0; 
        } 
        h1, h2, h3 { 
            color: #554295; 
            font-family: trebuchet MS; 
        } 
        h1 { 
            background: url("media/ui/bgrd_tabs_top.gif") repeat-x scroll left top transparent; 
            border: 1px solid #DDDDDD; 
            font-size: 1.5em; 
            margin: 4px; 
            padding: 6px 6px 7px; 
        } 
 
        table { 
            border: 0 none; 
            border-collapse: collapse; 
            font-size: 1em; 
            margin: 0 0 0 0px; 
        } 
        tr.hdr { 
            color: black; 
            font-weight: bold; 
        } 
        tr.odd { 
            background-color: lightgrey; 
            color: black; 
            cursor: default; 
        } 
        tr.even { 
            background-color: #E9E8DE; 
            color: black; 
            cursor: default; 
        } 
        tr.even:hover, tr.odd:hover { 
            background-color: #F0F0C0; 
        } 
        td { 
            border-bottom: 1px solid white; 
            border-right: 1px solid white; 
            padding: 2px 6px; 
        } 
        td.error { 
            color: red; 
            font-weight: bold; 
        } 
        td.cal01 { 
            background-color: #123456; 
            color: white; 
            white-space: nowrap; 
        } 
        td.cal02 { 
            background-color: #234567; 
            color: white; 
            width: 10px; 
        } 
        td.cal03 { 
            background-color: #E0E0E0; 
            color: black; 
            width: 12px; 
        } 
        td.e { 
            background-color: #E0E0E0; 
            color: #C8C8C8; 
            width: 12px; 
        } 
        td.r0 { 
            background-color: #FF5050; 
            color: blue; 
            white-space: nowrap; 
        } 
        td.r1 { 
            background-color: #F0F0C0; 
            color: black; 
            white-space: nowrap; 
        } 
        td.r2 { 
            background-color: #C0C0F0; 
            color: black; 
            white-space: nowrap; 
        } 
        td.r3 { 
            background-color: #F0E0B0; 
            color: black; 
            white-space: nowrap; 
        } 
        td.r4 { 
            background-color: #D0C0E0; 
            color: red; 
            white-space: nowrap; 
        } 
        td.r5 { 
            background-color: #C0F0F0; 
            color: black; 
            white-space: nowrap; 
        } 
        td.r6 { 
            background-color: #C0F0D0; 
            color: black; 
            white-space: nowrap; 
        } 
        td.r7 { 
            background-color: #C0C0C0; 
            color: black; 
            white-space: nowrap; 
        } 
        td.per0 { 
            background-color: #E566FF; 
            color: black; 
            cursor: default; 
        } 
        td.per2 { 
            background-color: #7F7F99; 
            color: black; 
            cursor: default; 
        } 
        td.per5 { 
            background-color: #6600FF; 
            color: white; 
            cursor: default; 
        } 
        td.per3 { 
            background-color: #66FFF0; 
            color: black; 
            cursor: default; 
        } 
        td.per6 { 
            background-color: #4C334C; 
            color: white; 
            cursor: default; 
        } 
        td.per13 { 
            background-color: #4C4C4C; 
            color: white; 
            cursor: default; 
        } 
        td.per7 { 
            background-color: #00F0E5; 
            color: red; 
            cursor: default; 
        } 
        td.per4 { 
            background-color: #3300CC; 
            color: red; 
            cursor: default; 
        } 
        td.per8 { 
            background-color: #6600FF; 
            color: black; 
            cursor: default; 
        } 
        td.per9 { 
            background-color: #3366FF; 
            color: black; 
            cursor: default; 
        } 
        td.per10 { 
            background-color: #0066FF; 
            color: red; 
            cursor: default; 
        } 
        td.per11 { 
            background-color: #0066FF; 
            color: white; 
            cursor: default; 
        } 
        td.per12 { 
            background-color: #BB99FF; 
            color: black; 
            cursor: default; 
        } 
        td.per14 { 
            background-color: #3300CC; 
            color: white; 
            cursor: default; 
        } 
        td.ofr0 { 
            background-color: #88FF88; 
            color: black; 
            cursor: default; 
            white-space: nowrap; 
        } 
        td.ofr1 { 
            background-color: #AAFF00; 
            color: red; 
            cursor: default; 
            white-space: nowrap; 
        } 
        td.ofr2 { 
            background-color: #AAFF00; 
            color: black; 
            cursor: default; 
            white-space: nowrap; 
        } 
        td.ofr3 { 
            background-color: #339900; 
            color: white; 
            cursor: default; 
            white-space: nowrap; 
        } 
        td.ofr4 { 
            background-color: #88FF88; 
            color: black; 
            cursor: default; 
            white-space: nowrap; 
        } 
        td.olap0 { 
            background-color: #FF0066; 
            color: blue; 
            cursor: default; 
            white-space: nowrap; 
        } 
        td.lms8 { 
            background-color: #FF6600; 
            color: white; 
            cursor: default; 
            white-space: nowrap; 
        } 
        td.lms10 { 
            background-color: #FF3F3F; 
            color: black; 
            cursor: default; 
            white-space: nowrap; 
        } 
        td.lms11 { 
            background-color: #FFFF00; 
            color: black; 
            cursor: default; 
            white-space: nowrap; 
        } 
        td.lms12 { 
            background-color: #FFFF00; 
            color: red; 
            cursor: default; 
            white-space: nowrap; 
        } 
 
                .site{  
                        margin:0 auto;   
                        width: 1151px;  
                }  
 
                #container{      
                }  
 
                #wrap{  
                         padding :0px;  
                         height: 500px;   
                         width: 1000px;  
                         overflow: auto;  
                         float:left;  
                }  
 
                 #menu{  
                         height: 480px;   
                         width: 150px;  
                         overflow: hidden;  
                         float : left;  
                }  
 
 
 
                 #top{  
                        width: 1000px;  
                        margin-left:150px;  
                        float:left;  
                        overflow: hidden;  
                 }
Ensuite le code de ma page :
Code :
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
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN:la" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
 
<html> 
    <title> 
    </title>  
    <head>  
        <script type="text/javascript">  
                function scrollTwin(){  
                    document.getElementById("wrap").onscroll = function(){  
                        document.getElementById("top").scrollLeft = document.getElementById("wrap").scrollLeft;  
                        document.getElementById("menu").scrollTop = document.getElementById("wrap").scrollTop;  
                    }  
                }  
        </script>  
 
 
        <!--[if IE 7]> <--> 
            <link href="mozilla_style.css" rel="stylesheet" type="text/css" /> 
        <!--> <![endif]--> 
 
 
        <!--[if lte IE 6]> 
            <link href="ie_style.css" rel="stylesheet" type="text/css" /> 
        <![endif]--> 
 
    </head>  
 
 
 
    <body onLoad="scrollTwin()">  
 
        <div class="site">  
            <div class="top" id="top">  
                <table id="data"> 
                    <tr> 
                        <td class="cal02"> 
                        </td> 
                    </tr> 
                </table> 
            </div>  
 
            <div style="clear:both"></div>  
 
            <div id="container">  
                <div id="menu">  
                        <table id="name"> 
                            <tr> 
                                <td class="r1"> 
                                    //contenu 
                                </td> 
                            </tr> 
                        </table> 
                    </div> 
 
                <div class="top" id="wrap" >  
                   <table> 
                       <tr> 
                            <td class="e"> 
                                //contenu 
                            </td> 
                       </tr> 
                   </table> 
                </div>  
            </div>  
 
            <div style="clear:both"></div>  
 
            </div>  
 
</body>  
 
</html>
Voilà ^^, si je devais afficher tout le contenu de la page ^^, surtout que c'est en dur pour le moment dans le code. Je risquerais de remplir le forum entier.
Donc j'espère que vous pourrez m'aider. Et je vous remercie .
Images attachées
Type de fichier : jpg alignement.JPG (30,4 Ko, 9 affichages)
breizhlama est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 25/03/2011, 13h49   #2
Membre habitué
 
Avatar de Melcain
 
Homme Amine El Fahdi
Étudiant
Inscription : mars 2011
Messages : 75
Détails du profil
Informations personnelles :
Nom : Homme Amine El Fahdi
Localisation : Maroc

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : mars 2011
Messages : 75
Points : 111
Points : 111
Je ne sais pas pour le CSS mais l'html est à revoir. sinon au niveau du CSS c'est sur le padding que ca va se jouer je crois:/

y'a une balise table qui ferme pas, une class avec e dans le code une id (data je crois) utilisé plus d'une fois... bref c'est pas tres clair
Melcain est actuellement connecté   Envoyer un message privé Réponse avec citation 00
Vieux 25/03/2011, 14h03   #3
Invité de passage
 
Inscription : mars 2010
Messages : 46
Détails du profil
Informations forums :
Inscription : mars 2010
Messages : 46
Points : 4
Points : 4
Ahhh oui je viens de voir ça, c'est juste du problème de recopie pour la balise <table> qui fermait pas, et pour class aussi. Parce que j'ai du trier le contenu des informations dans les tableaux. Parce que ça aurait totalement noyé le code. J'ai quand même vérifié si c'est erreur se trouvait pas dans mon code source et elle n'y sont pas. Merci d'avoir réagit.
breizhlama est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 23h11.


 
 
 
 
Partenaires

Hébergement Web