What is up with my spacing here? When the labels contain text the spacing is fine but then they are empty they have white space between each label. Why is extra space being added when the labels contain empty text?With text in labels (what I want it to look like):
With no text in labels (how I do not want it to look like):
On the C# code behind side:\[code\] // On page load for (int i = 1; i < 10; i++) { string ID = i.ToString(); PopulateLastNameLabel(ID); } protected void PopulateLastNameLabel(string ID) { Label lbl = new Label(); lbl.Width = 70; lbl.Height = 20; lbl.Text = ""; lbl.BackColor = System.Drawing.Color.Red; lbl.ID = "lastname_" + ID; pnlLastNameLabel.Controls.Add(lbl); }\[/code\]On the ASP.NET side:\[code\]<asp:Table ID="tblDisplayTable" runat="server"> <asp:TableRow> <asp:TableCell> <aspanel ID="pnlPrizeNumberLabel" runat="server" Width="80px"></aspanel> </asp:TableCell> <asp:TableCell HorizontalAlign="Center" VerticalAlign="Middle"> <aspanel ID="pnlPrizeDropDownList" runat="server" Width="130px"></aspanel> </asp:TableCell> <asp:TableCell> <aspanel ID="pnlNickNameLabel" runat="server" Width="70px"></aspanel> </asp:TableCell> <asp:TableCell> <aspanel ID="pnlPrizeNicknameTextBox" runat="server" Width="125px"></aspanel> </asp:TableCell> <asp:TableCell> <aspanel ID="pnlFirstNameLabel" runat="server" Width="70px"></aspanel> </asp:TableCell> <asp:TableCell> <aspanel ID="pnlLastNameLabel" runat="server" Width="70px"></aspanel> </asp:TableCell> <asp:TableCell> <aspanel ID="pnlEmailAddressLabel" runat="server" Width="140px"></aspanel> </asp:TableCell> <asp:TableCell> <aspanel ID="pnlAddButton" runat="server" Width="40px"></aspanel> </asp:TableCell> </asp:TableRow> </asp:Table>\[/code\]