Bonjour
je souhaiterai mettre une valeur variable dans la balise Caption pour une table.
J'ai essayé avec ID='xxx', mais cela n'est pas autorisé.
Y-a t' il un moyen?
Bonjour
je souhaiterai mettre une valeur variable dans la balise Caption pour une table.
J'ai essayé avec ID='xxx', mais cela n'est pas autorisé.
Y-a t' il un moyen?
Pour comprendre mieux votre demande, un exemple de code sera le bienvenue
![]()
voila un extrait:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 if i=1 then titi.value=z <div style='position:absolute; top:220px; left:310px' > <table cellspacing="2px" cellpadding="2px;" rules="all" style="border:solid 1px black;; background-color:aqua;"> <caption style='caption-side:bottom; font-weight:bold; text-decoration:underline;' ID='titi'></caption>
Trouvé sur un autre site :
Testez ce
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 <html> <HTA:APPLICATION APPLICATIONNAME="Création , Modification et Suppression du Caption(légende) d'une table" BORDER="THIN" BORDERSTYLE="NORMAL" ICON="Explorer.exe" INNERBORDER="NO" MAXIMIZEBUTTON="NO" MINIMIZEBUTTON="NO" SCROLL="NO" SELECTION="NO" SINGLEINSTANCE="YES"/> <body> <title>Création , Modification et Suppression du Caption(légende) d'une table</title> <p>Cliquez sur le bouton pour créer un élément de légende pour la table ou bien pour la modifier ou bien pour la supprimer !</p> <center><table ID = "myTable" cellspacing="2px" cellpadding="2px;" rules="all" style="border:solid 1px black;; background-color:aqua;"> <tr> <td>cell 1</td> <td>cell 2</td> <td>cell 3</td> <td>cell 4</td> <td>cell 5</td> </tr> <tr> <td>cell 6</td> <td>cell 7</td> <td>cell 8</td> <td>cell 9</td> <td>cell 10</td> </tr> </table> <br> <button onclick="CreationCaption()">créer un élément de Caption</button> <button onclick="ModifierCaption()">Modifier un élément de Caption</button> <button onclick="SupprimerCaption()">Supprimer un élément de Caption</button> <META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES"> <SCRIPT LANGUAGE="VBScript"> sub CreationCaption() Dim MyCaption Set MyCaption = document.getElementById("myTable").createCaption() MyCaption.innerHTML = "<b>Caption 1 ==> Papyxy</b>" end sub '***************************************************************** sub ModifierCaption() Dim MyCaption Set MyCaption = document.getElementById("myTable").createCaption() MyCaption.innerHTML = "<b>Caption 2 ==> Hackoo</b>" end sub '***************************************************************** Sub SupprimerCaption() document.getElementById("myTable").deleteCaption() End Sub '***************************************************************** </script> </body> </html>
Encore une fois merci. C'est ce qu'il me fallait.
Je n'aurais jamais trouvé seul cette solution car j'ai encore beaucoup de lacunes dans ce domaine.
Partager