Bonjour,
le code suivant:
fait apparaître mon tableau (au moins dans IE) avec un espace blanc au-dessus, alors que quand je le mets directement dans le html (lignes commentées), il n'y a pas cet espace blanc.
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 <head> <script language="javascript"> function display() { var _text = ''; _text += '<table width="95%" align="center" cellspacing="0" cellpadding="2" style="background-color: #fff; border 1px solid #ccc;"><tr style="background-color: #fff;"><td>-</td></tr>'; _text += '<tr style="background-color: #eee;"><td>-</td></tr>'; _text += '<tr style="background-color: #fff;"><td>-</td></tr>'; _text += '<tr style="background-color: #eee;"><td>-</td></tr>'; _text += '<tr style="background-color: #fff;"><td>-</td></tr>'; _text += '<tr style="background-color: #eee;"><td>-</td></tr>'; _text += '<tr style="background-color: #fff;"><td>-</td></tr>'; _text += '<tr style="background-color: #eee;"><td>-</td></tr>'; _text += '<tr style="background-color: #fff;"><td>-</td></tr>'; _text += '<tr style="background-color: #eee;"><td>-</td></tr>'; _text += '<tr style="background-color: #fff;"><td>-</td></tr>'; _text += '<tr style="background-color: #eee;"><td>-</td></tr>'; _text += '<tr style="background-color: #fff;"><td>-</td></tr>'; _text += '<tr style="background-color: #eee;"><td>-</td></tr>'; _text += '<tr style="background-color: #fff;"><td>-</td></tr>'; _text += '<tr style="background-color: #eee;"><td>-</td></tr>'; _text += '<tr style="background-color: #fff;"><td>-</td></tr>'; _text += '<tr style="background-color: #eee;"><td>-</td></tr>'; _text += '<tr style="background-color: #fff;"><td>-</td></tr>'; _text += '<tr style="background-color: #eee;"><td>-</td></tr>'; _text += '<tr style="background-color: #fff;"><td>-</td></tr>'; _text += '<tr style="background-color: #eee;"><td>-</td></tr>'; _text += '<tr style="background-color: #fff;"><td>-</td></tr>'; _text += '</table>'; alert(_text); document.getElementById('main').innerHTML = _text; } </script> </head> <body onload="display(); return(false);"> <table width="260" align="left" cellpadding="0" cellspacing="0" style="background-color: #ffc;"> <tr> <td id="title" height="30" valign="middle" style="border-bottom: 1px solid #CCC; background-color: #800;"> </td> </tr> <tr> <td valign="middle"> <div id='main' align="center" valign="middle" style="width: 260; height: 210; overflow: auto; scrollbar-face-color: rgb(128,0,0);"> <!-- <table width="95%" align="center" cellspacing="0" cellpadding="2" style="background-color: #fff; border 1px solid #ccc;"><tr style="background-color: #fff;"><td>-</td></tr> <tr style="background-color: #eee;"><td>-</td></tr> <tr style="background-color: #fff;"><td>-</td></tr> <tr style="background-color: #eee;"><td>-</td></tr> <tr style="background-color: #fff;"><td>-</td></tr> <tr style="background-color: #eee;"><td>-</td></tr> <tr style="background-color: #fff;"><td>-</td></tr> <tr style="background-color: #eee;"><td>-</td></tr> <tr style="background-color: #fff;"><td>-</td></tr> <tr style="background-color: #eee;"><td>-</td></tr> <tr style="background-color: #fff;"><td>-</td></tr> <tr style="background-color: #eee;"><td>-</td></tr> <tr style="background-color: #fff;"><td>-</td></tr> <tr style="background-color: #eee;"><td>-</td></tr> <tr style="background-color: #fff;"><td>-</td></tr> <tr style="background-color: #eee;"><td>-</td></tr> <tr style="background-color: #fff;"><td>-</td></tr> <tr style="background-color: #eee;"><td>-</td></tr> <tr style="background-color: #fff;"><td>-</td></tr> <tr style="background-color: #eee;"><td>-</td></tr> <tr style="background-color: #fff;"><td>-</td></tr> <tr style="background-color: #eee;"><td>-</td></tr> <tr style="background-color: #fff;"><td>-</td></tr> </table> --> </div> </td> </tr> <tr> <td id="bottom" height="20" valign="middle" style="border-top: 1px solid #CCC;"> </td> </tr> </table> </body>
Apparemment, lorsqu'on met moins de lignes dans le tableau, cet espace disparaît.
Quelqu'un aurait-il une idée ? Comment se débarrasser de cet effet indésirable ?
Merci
Jérôme
Partager