Solved

ASP.net markup problem with table alignment

Posted on 2016-10-18
2
50 Views
Last Modified: 2016-10-21
Hi

I have a table on my ASP.net web form, the markup for which is shown below. There are tables inside the cells of the main table. I moved a button onto it temporarily in design view and it threw the alignment out on the boxes for foreman. How do I correct this?

1
<table>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    <table>
                   <tr>
                       <td>
                           <asp:Label ID="Label1" runat="server" Text="Supervisor Name"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:TextBox ID="txtSupervisorName" runat="server" Width="180px"></asp:TextBox>
                       </td>
                   </tr>
                                 <tr>
                       <td>
                           <asp:Label ID="Label3" runat="server" Text="Supervisor Signature"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:TextBox ID="txtSupervisorSignature" runat="server" Width="180px"></asp:TextBox>
                       </td>
                   </tr>
                    </table>

                </td>
                <td></td>
                <td>
                                        <table>
                   <tr>
                       <td>
                           <asp:Label ID="Label4" runat="server" Text="Geologist Name"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:TextBox ID="txtGeologistName" runat="server" Width="180px"></asp:TextBox>
                       </td>
                   </tr>
                                 <tr>
                       <td>
                           <asp:Label ID="Label5" runat="server" Text="Geologist Signature"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td class="auto-style1">
                           <asp:TextBox ID="txtGeologistSignature" runat="server" Width="180px"></asp:TextBox>
                       </td>
                   </tr>
                    </table>
                </td>
                <td></td>
                <td class="auto-style2">
                                        <table>
                   <tr>
                       <td>
                           <asp:Label ID="Label6" runat="server" Text="Foreman Name"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:TextBox ID="txtForemanName" runat="server" Width="193px"></asp:TextBox>
                       </td>
                   </tr>
                                 <tr>
                       <td>
                           <asp:Label ID="Label7" runat="server" Text="Foreman Signature"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:TextBox ID="txtForemanSignature" runat="server" Width="180px"></asp:TextBox>
                       </td>
                   </tr>
                                            <tr>
                                                <td></td>
                                            </tr>
                    </table>
                </td>
                <td></td>
                <td>
                                        <table>
                   <tr>
                       <td>
                           <asp:Label ID="Label8" runat="server" Text="Mine Overseer Name"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:TextBox ID="txtMineOverseer" runat="server" Width="180px"></asp:TextBox>
                       </td>
                   </tr>
                                 <tr>
                       <td>
                           <asp:Label ID="Label9" runat="server" Text="Mine Overseer Signature"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:TextBox ID="txtMineOverseerSignature" runat="server" Width="180px"></asp:TextBox>
                       </td>
                   </tr>
                    </table>
                </td>
                <td>
                     &nbsp;</td>
                <td>
                                        <table>
                   <tr>
                       <td>
                     <asp:Button ID="printButton" runat="server" Text="Print Page" OnClientClick="javascript:window.print();" Width="180px" />
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:Button ID="btnHideUnusedColumns" runat="server" Text="Hide Unused Columns" Width="180px" />
                       </td>
                   </tr>
                                 <tr>
                       <td>
                           <asp:Button ID="btnShowUnusedColumns0" runat="server" Text="Show Unused Columns" Width="180px" />
                                     </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:Button ID="btnBackToCalendar" runat="server" Text="Back to Calendar" Width="180px" />
                       </td>
                   </tr>
                    </table>
                </td>
            </tr>
        </table>
0
Comment
Question by:murbro
2 Comments
 
LVL 50

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 41847988
delete the extra:

<tr>
                                                <td></td>
                                            </tr>

Open in new window

hence, you would need this instead:
<table>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    <table>
                   <tr>
                       <td>
                           <asp:Label ID="Label1" runat="server" Text="Supervisor Name"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:TextBox ID="txtSupervisorName" runat="server" Width="180px"></asp:TextBox>
                       </td>
                   </tr>
                                 <tr>
                       <td>
                           <asp:Label ID="Label3" runat="server" Text="Supervisor Signature"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:TextBox ID="txtSupervisorSignature" runat="server" Width="180px"></asp:TextBox>
                       </td>
                   </tr>
                    </table>

                </td>
                <td></td>
                <td>
                                        <table>
                   <tr>
                       <td>
                           <asp:Label ID="Label4" runat="server" Text="Geologist Name"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:TextBox ID="txtGeologistName" runat="server" Width="180px"></asp:TextBox>
                       </td>
                   </tr>
                                 <tr>
                       <td>
                           <asp:Label ID="Label5" runat="server" Text="Geologist Signature"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td class="auto-style1">
                           <asp:TextBox ID="txtGeologistSignature" runat="server" Width="180px"></asp:TextBox>
                       </td>
                   </tr>
                    </table>
                </td>
                <td></td>
                <td class="auto-style2">
                                        <table>
                   <tr>
                       <td>
                           <asp:Label ID="Label6" runat="server" Text="Foreman Name"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:TextBox ID="txtForemanName" runat="server" Width="193px"></asp:TextBox>
                       </td>
                   </tr>
                                 <tr>
                       <td>
                           <asp:Label ID="Label7" runat="server" Text="Foreman Signature"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:TextBox ID="txtForemanSignature" runat="server" Width="180px"></asp:TextBox>
                       </td>
                   </tr>
                                            
                    </table>
                </td>
                <td></td>
                <td>
                                        <table>
                   <tr>
                       <td>
                           <asp:Label ID="Label8" runat="server" Text="Mine Overseer Name"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:TextBox ID="txtMineOverseer" runat="server" Width="180px"></asp:TextBox>
                       </td>
                   </tr>
                                 <tr>
                       <td>
                           <asp:Label ID="Label9" runat="server" Text="Mine Overseer Signature"></asp:Label>
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:TextBox ID="txtMineOverseerSignature" runat="server" Width="180px"></asp:TextBox>
                       </td>
                   </tr>
                    </table>
                </td>
                <td>
                     &nbsp;</td>
                <td>
                                        <table>
                   <tr>
                       <td>
                     <asp:Button ID="printButton" runat="server" Text="Print Page" OnClientClick="javascript:window.print();" Width="180px" />
                       </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:Button ID="btnHideUnusedColumns" runat="server" Text="Hide Unused Columns" Width="180px" />
                       </td>
                   </tr>
                                 <tr>
                       <td>
                           <asp:Button ID="btnShowUnusedColumns0" runat="server" Text="Show Unused Columns" Width="180px" />
                                     </td>
                   </tr>
                      <tr>
                       <td>
                           <asp:Button ID="btnBackToCalendar" runat="server" Text="Back to Calendar" Width="180px" />
                       </td>
                   </tr>
                    </table>
                </td>
            </tr>
        </table>

Open in new window

0
 

Author Closing Comment

by:murbro
ID: 41854879
Thanks very much
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question