I am new to prototype and need to learn how to traverse an html table
and hide some columns. The only id I have is table id or the class it
is associated with. Can anyone give me an example?

Here is what I am trying to accomplish.

 var tbl =

          if (tbl != null){

           var rows = tbl.getElementsByTagName('tr');

           var cols = rows[0].getElementsByTagName('th');
           cols[0].style.width = '300px';
           cols[1].style.display = 'none';
           cols[2].style.display = 'none';

           //Now loop through the data rows and hide specific cells
           for (var row = 1; row < rows.length; row++) {
               var cels = rows[row].getElementsByTagName('td');
               cels[0].style.width = '300px';
               cels[1].style.display = 'none';
               cels[2].style.display = 'none';




You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to