E
Eric
I have a user control (with three controls inside it) that appears multiple
times in the containing page. Sometimes I want to hide the rightmost
control in the UC but if I do that it screws up the horizontal alignment of
the other two controls. It appears that they are being stretched due to the
absence of the others and I'm not sure how to fix it.
If I dont hide anything it looks all lined up (each line is a web user
control):
Label DropDownList CheckBox
Label DropDownList CheckBox
Label DropDownList CheckBox
However, sometimes I want to hide the check box for a given line but it
messes up the alignment when I do that (notice the spacing on the second
line):
Label DropDownList CheckBox
Label DropDownList
Label DropDownList CheckBox
What I want is for the vertical alignment of each Label, and each DropDown
to be ok regardless of if the CheckBox shows (and I wan the check boxes
lined up too).
--------------------------------------------
Here is the HTML I use for the User Control:
<table width=375 border=0 cellpadding=0 cellspacing=0>
<tr width=100%>
<td width=50%>
<aspropDownList ID="ddlData" runat="server" />
</td>
<td width=15%>
<asp:CheckBox ID="chkSuppress" runat="server" Text="Suppress" />
</td>
</tr>
</table>
I tried making the first two columns its own table inside the first column
of the outer table but got the same effect. What I suspect is that since
the third column is hidden for a given row then the first two get stretched
some. If I set the table to show borders it definitely shows the first
two columns oversized.
Can anyone provide advice?
Thanks.
times in the containing page. Sometimes I want to hide the rightmost
control in the UC but if I do that it screws up the horizontal alignment of
the other two controls. It appears that they are being stretched due to the
absence of the others and I'm not sure how to fix it.
If I dont hide anything it looks all lined up (each line is a web user
control):
Label DropDownList CheckBox
Label DropDownList CheckBox
Label DropDownList CheckBox
However, sometimes I want to hide the check box for a given line but it
messes up the alignment when I do that (notice the spacing on the second
line):
Label DropDownList CheckBox
Label DropDownList
Label DropDownList CheckBox
What I want is for the vertical alignment of each Label, and each DropDown
to be ok regardless of if the CheckBox shows (and I wan the check boxes
lined up too).
--------------------------------------------
Here is the HTML I use for the User Control:
<table width=375 border=0 cellpadding=0 cellspacing=0>
<tr width=100%>
</td></asp:Label>
<td width=50%>
<aspropDownList ID="ddlData" runat="server" />
</td>
<td width=15%>
<asp:CheckBox ID="chkSuppress" runat="server" Text="Suppress" />
</td>
</tr>
</table>
I tried making the first two columns its own table inside the first column
of the outer table but got the same effect. What I suspect is that since
the third column is hidden for a given row then the first two get stretched
some. If I set the table to show borders it definitely shows the first
two columns oversized.
Can anyone provide advice?
Thanks.