Bonjour,
J'essaie de limiter en hauteur un table mais sans succès
Code html : 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 <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="tableHautMax.aspx.vb" Inherits="Jquery.tableHautMax" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="/script/jquery-1.10.2.min.js" type="text/javascript"></script> <style type="text/css"> .MaxHeightPopup { border: 0; max-height: 100px; display: block; overflow-y: scroll; } </style> <script type="text/javascript"> $(function () { $("#btnAdd").click(function () { var HL = 50; var row = '<tr height=' + HL + '><td>1</td><td>2</td><td>3</td><td >4</td></tr>'; $('#tbdatas').append(row); }); }); </script> </head> <body> <button id="btnAdd"> Ajouter 1 ligne</button> <table class="MaxHeightPopup" id="tbdatas"> </table> </body> </html>
Voici mon code mais quand j'ajoute une ligne ça agrandi le tableau mais à l'infini et il n'y a jamais de scroll... Merci de votre aide.
Partager