NEWBIE - Button to hide a column in an HTML table

R

RockNRoll

Greetings,

I have a button on my page that, when clicked, I would like to hide a column
in an HTML table (or change the width of that column to 0px).

Is this possible? Can you please tell me how I can accomplish this?

Thanks,
-Dave
 
S

Steve Flitcroft

It is possible, you can access the table through dhtml and set the display style to none

Some example code
var SPANcoll = document.getElementsByTagName ("TD")

for (LC=0; LC < SPANcoll.length; LC++)

{

if (SPANcoll[LC].className == ColName)

{

SPANcoll[LC].style.display = hidden;

}

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top