• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Making a zero-width and zero-height table element

spamsk8r

Golden Member
So I'm building an html table, but I want to hide a full column. I.e., I do not want it to display, nor do I want it to take up space. It does, however, have data in it. I just don't want the user to see it (it has to be done this way as per orders from on high, and no this has nothing to do with any kind of homework). On all the elements in the column I've set the style as follows:

td.hiddenValue {
display: none;
width: 0px;
height: 0px;
}

But it's not working. Now, I'm not any kind of CSS guru (heck, I'm not even really a web designer, I just write backend code for the most part) so maybe I'm missing something simple here? Or is it just not possible to do? Any suggestions would be great, and please, if I can clarify any further let me know. Thanks in advance.
 
Just setting display to none should make the td disappear completely. What exactly is it doing instead?


I assume all the td's in the 'column' have their class set to 'hiddenValue'? Any other css relating to td's that might be overriding it?
 
Now that I look at it further, it seems that there's not a problem with the columns, but with the rows. Is it possible to hide a table row? It would seem not, since I attempted to set display: none; on a TR element and it rendered it anyway. Hrm, looks like I'm going to have to find a different way of doing this (the reason I can't just apply display: none; to all the TDs is that the table is generated by JavaServer Faces, so I don't have total control over it, and no direct access to style the TD elements (only the SPANs within the TDs). Thanks for the help, I'm going to have to rethink this whole thing.
 
That's odd. style='display:none' seems to work on a TR for me, as does setting element.style.display='none' in JS or in a stylesheet.
 
Back
Top