Bonjour,

j'aimerai fixer la largeur d'un div qui contiendra différents elements parmi lesquels une table. Le probleme, c'est que quand j'ajoute des colonnes à la table, la taille du div augmente au lieu de permettre l'utilisation de la scrollbar.

Le bout de code concerné :
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
			<div id="MainContent_PgListGenEcGpeInst0" style="max-width:350;">
            <table cellspacing="1" style="background-color:Black;width:100%;">
					<tr id="MainContent_PgListGenEcGpeInst0VigiGvdan_testdan_testRowTab" style="background-color:White;">
						<td style="background-color:White;"><span id="MainContent_PgListGenEcGpeInst0VigiGvdan_testdan_testLabTab">test</span></td><td><table id="MainContent_PgListGenEcGpeInst0VigiGvdan_testdan_test" cellspacing="0" cellpadding="0" style="border-collapse:collapse;width:98%;">
							<tr>
 
								<td>
                        <div style="overflow-x:scroll;">
									<div>
										<table cellspacing="0" rules="all" border="1" id="MainContent_test1" style="border-collapse:collapse;width:100%;">
											<tr style="background-color:White;">
												<th scope="col">&nbsp;</th><th scope="col">ID</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
                                    <th scope="col">Test</th>
 
											</tr>
										</table>
									</div>
								</div>
                        </td>
							</tr>
						</table></td>
					</tr>
 
				</table>
			</div>
J'ai essayé d'utiliser la propriété style.width, style.max-width mais rien n'y fait...

Si quelqu'un sait comment faire

Merci