Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/05/2012, 08:31
chinanzio
 
Fecha de Ingreso: marzo-2007
Mensajes: 82
Antigüedad: 17 años, 2 meses
Puntos: 21
Respuesta: Manipulando Tablas

Hola, he probado el siguiente código y, según lo que había entendido, funciona bien.
Cual es la diferencia con el tuyo ?

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  4. <title>Insert title here</title>
  5. </head>
  6.     <input type="button" value="showContentDos" onclick="showContentDos();"/>
  7.     <input type="checkbox" id="no" />
  8.     <table id="solicit">
  9.         <tr>
  10.             <td>uno</td>
  11.             <td>dos</td>
  12.             <td>tres</td>
  13.         </tr>
  14.         <tr>
  15.             <td>uno</td>
  16.             <td>dos</td>
  17.             <td>tres</td>
  18.         </tr>
  19.     </table>
  20.     <script>
  21.     function showContentDos() {
  22.         element = document.getElementById("contenidodos");
  23.         no = document.getElementById("no");
  24.         if (no.checked) {
  25.             // element.style.display='block';
  26.             ocultarColumna(1, true);
  27.         } else {
  28.             // element.style.display='none';
  29.             ocultarColumna(1, false);
  30.         }
  31.     }
  32.  
  33.     function ocultarColumna(num, ver) {
  34.         var dis = ver ? '' : 'none';
  35.         var fila = document.getElementById('solicit').getElementsByTagName('tr');
  36.         for (var i = 0; i < fila.length; i++)
  37.             fila[i].getElementsByTagName('td')[num].style.display = dis;
  38.     }
  39.         </script>
  40. </body>
  41. </html>
__________________
Hazle un favor a tu cerebro y juega Ajedrez online
Chess online