Zico250814
Messages postés9Date d'inscriptionjeudi 7 décembre 2017StatutMembreDernière intervention25 avril 2018
-
Modifié le 19 avril 2018 à 23:32
jordane45
Messages postés37499Date d'inscriptionmercredi 22 octobre 2003StatutModérateurDernière intervention27 mai 2023
-
20 avril 2018 à 06:45
Bonjour,
Merci d'avance pour votre aide.
ci-dessous, mon petit script.
Mon problème, c'est que pour masquer plusieurs colonnes le script fonctionne très-bien, mais quand on affiche après avoir masquer, les colonnes se converti en lignes. Je veux avoir le même tableau!!
Est-ce que vous avez une solution SVP. Merci encore.
<html>
<head>
<script type="text/javascript">
function HideCol() {
var table = document.getElementById ("Tab");
var x = table.rows[0].cells[1].style;
var x2 = table.rows[1].cells[1].style;
var x3 = table.rows[0].cells[2].style;
var x4 = table.rows[1].cells[2].style;
x.display = 'none';
x2.display = 'none';
x3.display = 'none';
x4.display = 'none';
}
function ShowCol() {
var table = document.getElementById ("Tab");
var x = table.rows[0].cells[1].style;
var x2 = table.rows[1].cells[1].style;
var x3 = table.rows[0].cells[2].style;
var x4 = table.rows[1].cells[2].style;
x.display = 'block';
x2.display = 'block';
x3.display = 'block';
x4.display = 'block';
}
</script>
</head>
<body>
<table border="3px" id="Tab">
<tr>
<td>France</td>
<td>Paris</td>
<td>Lyon</td>
<td>Marseille</td>
</tr>
<tr>
<td>Italie</td>
<td>Rome</td>
<td>Napoli</td>
<td>Milan</td>
</tr>
</table>
<button onclick="HideCol(); ">-</button>
<button onclick="ShowCol(); ">+</button>
</body>
</html>
jordane45
Messages postés37499Date d'inscriptionmercredi 22 octobre 2003StatutModérateurDernière intervention27 mai 2023341 Modifié le 20 avril 2018 à 06:45