We help IT Professionals succeed at work.

Table layout problems in IE and Firefox - sorry, it's just a browser question

spaceneedlejumper
on
Medium Priority
229 Views
Last Modified: 2013-12-08
Any ideas for why IE insists on moving the second column over further to the right than it should be?

If I delete lines 168 through 182 the displays goes back to the way it should be, but of course, I need those lines and don't see anything wrong with them.

Also if anyone knows why Firefox puts the gridview on the left.  I can probably fix that with some kind of <span> or <div> tag or even an "align=center"

If someone could help with this that would be awesome!
<%@ Page Language="VB" MasterPageFile="~/Student.master" AutoEventWireup="false" CodeFile="StudentViewProfile.aspx.vb" Inherits="StudentViewProfile" title="Untitled Page" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="information" Runat="Server">
 
<br /><br />
 
<table border="0" cellpadding="0" cellspacing="0" width="600px">
<tr><td width="75px">&nbsp;</td>
    <td width="525px">
 
        <table border="0" cellpadding="0" cellspacing="0" width="525px">
        <tr>
            <td class="EmployerCompanyProfileHeader1" colspan="4">Student Profile:</td>
        </tr>
        <tr><td colspan="4">&nbsp;</td></tr>
        <tr><td colspan="3" class="EmployerWizardSummaryHeader">Contact Information</td>
            <td><asp:HyperLink ID="EditProfile" runat="server" NavigateUrl="~/StudentContactInfo.aspx?from=viewprofile">Edit</asp:HyperLink></td></tr>
        <tr><td colspan="4"><hr style="color:Teal" /></td></tr>
        <tr>
            <td class="EmpWizard1">&nbsp;</td>
            <td class="EmpWizard2">EDCC ID Number:</td>
            <td class="EmpWizard3">&nbsp;</td>
            <td class="EmpWizard5">
                <asp:Label ID="lblStu_EDCCID" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="EmpWizard1">&nbsp;</td>
            <td class="EmpWizard2">First Name:</td>
            <td class="EmpWizard3">&nbsp;</td>
            <td class="EmpWizard5">
                <asp:Label ID="lblStu_FirstName" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="EmpWizard1">&nbsp;</td>
            <td class="EmpWizard2">Last Name:</td>
            <td class="EmpWizard3">&nbsp;</td>
            <td class="EmpWizard5">
                <asp:Label ID="lblStu_LastName" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="EmpWizard1">&nbsp;</td>
            <td class="EmpWizard2">Street Address:</td>
            <td class="EmpWizard3">&nbsp;</td>
            <td class="EmpWizard5">
                <asp:Label ID="lblStu_StreetAddress" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="EmpWizard1">&nbsp;</td>
            <td class="EmpWizard2">Apartment Number:</td>
            <td class="EmpWizard3">&nbsp;</td>
            <td class="EmpWizard5">
                <asp:Label ID="lblStu_ApartmentNumber" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="EmpWizard1">&nbsp;</td>
            <td class="EmpWizard2">City:</td>
            <td class="EmpWizard3">&nbsp;</td>
            <td class="EmpWizard5">
                <asp:Label ID="lblStu_City" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="EmpWizard1">&nbsp;</td>
            <td class="EmpWizard2">State:</td>
            <td class="EmpWizard3">&nbsp;</td>
            <td class="EmpWizard5">
                <asp:Label ID="lblStu_State" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="EmpWizard1">&nbsp;</td>
            <td class="EmpWizard2">Zip Code:</td>
            <td class="EmpWizard3">&nbsp;</td>
            <td class="EmpWizard5">
                <asp:Label ID="lblStu_ZipCode" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="EmpWizard1">&nbsp;</td>
            <td class="EmpWizard2">Phone Number:</td>
            <td class="EmpWizard3">&nbsp;</td>
            <td class="EmpWizard5">
                <asp:Label ID="lblStu_Phone" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="EmpWizard1">&nbsp;</td>
            <td class="EmpWizard2">E-mail Address:</td>
            <td class="EmpWizard3">&nbsp;</td>
            <td class="EmpWizard5">
                <asp:Label ID="lblStu_EmailAddress" runat="server"></asp:Label>
            </td>
        </tr>
 
        <tr><td colspan="4">&nbsp;</td></tr>
        <tr><td colspan="4">&nbsp;</td></tr>
 
        <tr><td colspan="3" class="EmployerWizardSummaryHeader">Skills</td>
            <td><asp:HyperLink ID="EditSkills" runat="server" NavigateUrl="~/StudentSkills.aspx">Edit</asp:HyperLink></td></tr>
        <tr><td colspan="4"><hr style="color:Teal" /></td></tr>
        <tr>
            <td colspan="4" style="text-align:center">
            
                <table width="250px" border="0" cellpadding="0" cellspacing="0">
                <tr><td class="StudentSkillsHeader">Current Skills</td></tr>
                <tr><td class="StudentAddSkillsMiddle">&nbsp;</td></tr>
                <tr><td class="StudentAddSkillsMiddle">
                        <asp:GridView ID="GV_ShowSkills" runat="server" AutoGenerateColumns="False" 
                            DataSourceID="SqlDataShowSkills" Width="250px" GridLines="Horizontal" 
                            DataKeyNames="Stu_SkillID">
                            <Columns>
                                <asp:BoundField DataField="Stu_Skill" HeaderText="Skill" 
                                    SortExpression="Stu_Skill">
                                    <HeaderStyle ForeColor="#000099" />
                                    <ItemStyle ForeColor="#003366" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="Experience" SortExpression="Stu_YearsUsed">
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="ddlEditExperience" runat="server" DataTextField="Stu_YearsUsed" SelectedValue='<%# Bind("Stu_YearsUsed") %>'>
                                            <asp:ListItem Value="3 Months">3 Months</asp:ListItem>
                                            <asp:ListItem Value="6 Months">6 Months</asp:ListItem>
                                            <asp:ListItem Value="1 Year">1 Year</asp:ListItem>
                                            <asp:ListItem Value="2 Years">2 Years</asp:ListItem>
                                            <asp:ListItem Value="3 Years">3 Years</asp:ListItem>
                                            <asp:ListItem Value="4 Years">4 Years</asp:ListItem>
                                            <asp:ListItem Value="5 to 10 Years">5 to 10 Years</asp:ListItem> 
                                            <asp:ListItem Value="10+ Years">10+ Years</asp:ListItem>
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Stu_YearsUsed") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle ForeColor="#000099" />
                                    <ItemStyle ForeColor="#003366" />
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </td></tr>
                <tr><td class="StudentSkillsHeader">&nbsp;</td></tr>
                <tr><td class="StudentSkillsHeader">
                    <asp:SqlDataSource ID="SqlDataShowSkills" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:StudentConnectionString %>" 
                        SelectCommand="SELECT * FROM [skills] WHERE ([Stu_AutoNum] = @Stu_AutoNum) ORDER BY [Stu_Skill], [Stu_YearsUsed]">
                        <SelectParameters>
                            <asp:SessionParameter Name="Stu_AutoNum" SessionField="Stu_AutoNum" Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    </td></tr>
                </table>
                
            </td>
        </tr>
 
        <tr><td colspan="4">&nbsp;</td></tr>
        <tr><td colspan="4">&nbsp;</td></tr>
 
        <tr><td colspan="3" class="EmployerWizardSummaryHeader">Resum&#233;</td>
            <td><asp:HyperLink ID="EditResume" runat="server" NavigateUrl="~/StudentResume.aspx">Edit</asp:HyperLink></td></tr>
        <tr><td colspan="4"><hr style="color:Teal" /></td></tr>
 
        <tr>
            <td colspan="4">
                <table width="525px" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="25px">&nbsp;</td>
                    <td width="500px">
                        <span style="color:Yellow; font-weight:bold;">Your Current Resum&#233;:</span>
                        &nbsp;&nbsp;&nbsp;
                        <asp:HyperLink ID="Hyp_ViewMyResume" runat="server" Target="_blank" Text="" Visible="false" NavigateUrl=""></asp:HyperLink>
                        <asp:Label ID="lbl_NoResume" runat="server" Text="" Visible="false">No Resum&#233; on file</asp:Label>
                    </td>
                </tr>
                </table>
            </td>
        </tr>
 
        <tr><td colspan="4">&nbsp;</td></tr>
        <tr><td colspan="4">&nbsp;</td></tr>
        
        <tr><td colspan="4" class="EmployerWizardSummaryHeader">References
            <hr style="color:Teal" /></td></tr>
        <tr><td colspan="4">&nbsp;</td></tr>
        <tr><td colspan="4" class="EmployerWizardSummaryHeader">Job Filter
            <hr style="color:Teal" /></td></tr>
        </table>
 
    </td>
</tr>
</table>    
 
 
</asp:Content>

Open in new window

IE-Screenshot.gif
FirefoxScreenshot.gif
Comment
Watch Question

Try replacing line 21-28 like this. Also try to put &nbsp; for empty spaces inside the table <td> <td> to be replaced with <td>&nbsp;</td>
        <tr>
            <td class="EmpWizard1">&nbsp;</td>
            <td class="EmpWizard2">EDCC ID Number:</td>
            <td class="EmpWizard3" style="width:20px;">&nbsp;</td>
            <td class="EmpWizard5">
                <asp:Label ID="lblStu_EDCCID" runat="server"></asp:Label>
            </td>
        </tr>
 
 
Firefox replace line 111 like this
 
                <table width="250px" border="0" cellpadding="0" cellspacing="0" align="center">

Open in new window

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thanks sunithnair,

The nbsp's were already in every empty table cell, it's just that the code parser up here at expert's exchange makes them blanks when it converts my code.

Your solution for Firefox worked flawlessly!

I decided to break up the table into several smaller tables and that fixed the layout problems with IE.

Thank you for your help.

Travis

Author

Commented:
Thank you very much!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.