Log in

View Full Version : Set height of the row when column is hiden



ismailc
10-22-2008, 10:48 AM
Hi, need help please!

Hiding column but can't set the height of row

I'm hiding the columns within the row, but can't seem to hide the row nor set the height of the row!

<tr style="visibility: hidden; height: 0px;">
<td colspan="4" style="visibility: hidden; height: 0px;">
"object"
</td>
</tr>

How can I set the height of the row when column is hiden.

Regards

TheJoshMan
10-22-2008, 12:00 PM
well by "hide the height of the row" i'm assuming you mean the space in which it would take up if it were visible...

In which case, the visibility property only makes an element transparent. Thus keeping the same real estate it would take up if it were visible.

If you want to completely remove the element AND the space it would take up, you need to use the display property.



td {
display:none;
}


now keep in mind, that code snippet will remove ALL <td> on your page... so if you have access to the html, you should add a class to that particular <td> so as to separate it from all the others.

like this...


<tr style="visibility: hidden; height: 0px;">
<td colspan="4" class="hideme">
"object"
</td>
</tr>

Then use this css...



<style type="text/css">
td.hideme{
display:none;
}
</style>

ismailc
10-22-2008, 12:12 PM
Thanks a million it works great...

<tr style="display:none;">

Regards