I'm developing a website and am attempting to create a properly aligned data entry form. Using a table structure I was expecting the controls to align properly, but to no avail. I've been using the ColumnSpan attribute of the <asp:TableCell> control to make the Title field span across the width of the entire form.
The Title <asp:TextBox> has a width property set to "100%", but the First and Last Name boxes have specificly sized pixel widths.
This is the result of my current code:
And the code itself:
<asp:Table runat="server">
<asp:TableRow>
<asp:TableCell>
First Name:
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="FirstNameTextBox" runat="server" Width="150px" />
</asp:TableCell>
<asp:TableCell>
Last Name:
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="LastNameTextBox" runat="server" Width="150px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
Title:
</asp:TableCell>
<asp:TableCell ColumnSpan="3">
<asp:TextBox ID="TitleTextBox" runat="server" Width="100%" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
As you can see the layout is simple enough. Unfortunately it just seems to take up a hair too much space. Any advice into removing the additional space on the Title <asp:TextBox> so that they align perfectly would be greatly appreciated.