PDA

Click to See Complete Forum and Search --> : hiding table rows


andymac
Dec 17th, 2001, 08:03 AM
Hi,
I've a data input screen that needs to show / hide rows depending if a user checks various option boxes. I can hide a row using style.visiblity but it still leaves a gap on the page. I then tried to set the style.height=1 to shrink the row up, but it still leaves all the other rows in the same place. How can I "roll up" the other rows ? Am I going to have to resize the screen myself or is this something that a <DIV> can deal with ?

ta

Andy

CiberTHuG
Dec 17th, 2001, 09:17 AM
Probably the best way to do what you want is to actually remove and add the rows, provided there isn't too much data that you have to store.

You could do this with seperate tables in divs, but that is just messy, as now you don't have a single long table.

The W3C has ECMAScript mapping to the DOM. There are functions that will let you remove and add nodes.

andymac
Dec 17th, 2001, 03:30 PM
Hi,
Found what I was looking for;

to hide the rows...

style="VISIBILITY: hidden; DISPLAY:none;"

to make them visible again

style="VISIBILITY: visible; DISPLAY:block;">

job done

cheers
Andy

CiberTHuG
Dec 17th, 2001, 03:41 PM
You could also try "table-row" or "table-row-group" for display settings, or "collapse" for visiblity settings.