Saturday, March 24, 2012

What is the best way to hide a <TR> or <TD> element in an HTML table?

Hello,

I have an HTML table with three rows. At run time, in my code-behind file, I may need to hide one or two of the rows, depending on a user-entered value in a related field. Since the TR tag does not support the "visible" attribute, what is the best way to hide a table row programmatically? Each row consists of two TD tags.

Thanks for helping.

BlackCatBoneUse CSS:

display: none;
Thanks for the assist. Following your suggestion, I used this approach successfully:

Row2.Style.Add( "DISPLAY", "none" );

BlackCatBone

0 comments:

Post a Comment