Javascript vous permet de faire des merveilles avec votre site web. On pourrait presque dire que les limites de celui-ci serait votre imagination. Nous allons donc voir ici comment cacher ou afficher à la volé une ligné dans une table. Vous avez certainement déjà vue ce principe sur plusieurs site. Alors voici le principe.
{geshibot lang="javascript" head="Javascript"}<script type="text/javascript">
function displayRow(){
var row = document.getElementById("MaLigneACacher");
if (row.style.display == '') row.style.display = 'none';
else row.style.display = '';}
</script>{/geshibot}
{geshibot lang="html4strict" head="Html"}<table width="300" border="1">
<tr id="MaLigneACacher">
<th>TH-1</th><th>TH-2</th><th>TH-3</th>
</tr>
<tr>
<td>cell-11</td><td>cell-12</td><td>cell-13</td>
</tr>
<tr>
<td>cell-21</td><td>cell-22</td><td>cell-23</td>
</tr>
</table>
<p><button onclick="displayRow()" >Afficher / Cacher</button></p>{/geshibot}
Marquer favoris
Bookmark
Email This
Hits: 344
Commentaires (0)

Ecrivez un commentaire





















