Internet Exporer 11渲染表不正确

时间:2016-08-08 11:27:36

标签: asp.net internet-explorer html-table

在我的页面上我有一个包含一些元素的表,但它在Internet Explorer 11中混乱。任何帮助表示赞赏

以下是VS中的样子:

enter image description here

在Chrome中:

enter image description here

在这里IE:

enter image description here

我的代码:

    <table>
        <tr>
            <td style="width: 50%; text-align: left"><br /><br /><br />
                <asp:Label ID="lbl_dm_rvi" runat="server" Text="sometext RVI"></asp:Label><br />
                <asp:Label ID="lbl_dm_odv" runat="server" Text="sometext ODV"></asp:Label>
            </td>
            <td style="width: 50%; text-align: right; text">
                <asp:Label ID="lbl_hochrechnung" runat="server" Text="Hochrechnung_RX_SM_KVBEZ"></asp:Label><br />
                <asp:Label ID="lbl_modul1" runat="server" Text="Modul 1"></asp:Label><br />
                <asp:Label ID="lbl_modul_30" runat="server" Text="Modul 3.0"></asp:Label><br />
                <asp:Label ID="lbl_modul_31" runat="server" Text="Modul 3.1"></asp:Label><br />
                <asp:Label ID="lbl_modul3" runat="server" Text="Modul 3"></asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <img src="klammer.png" style="width: 400px"/>
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center">
                <asp:Label ID="lbl_modul2" runat="server" Text="Modul 2"></asp:Label><br />
                <asp:Label ID="lbl_odv" runat="server" Text="ODV"></asp:Label><br />
                <asp:Label ID="lbl_modul2a" runat="server" Text="Modul 2a"></asp:Label><br />
                <asp:Label ID="lbl_modul4" runat="server" Text="Modul 4"></asp:Label><br />
                <asp:Label ID="lbl_modul4a" runat="server" Text="Modul 4a"></asp:Label>
            </td>
        </tr>
    </table>

1 个答案:

答案 0 :(得分:1)

我在第一个看到的是,IE上的表格占全宽,其他两个则没有。

这通常是因为它的浏览器没有对所有元素使用相同的默认设置。

快速解决方案是将表格上的宽度设置为

<table style="width: 300px;" >

所以你不要随意离开。

你也可以尝试使用任何试图将所有浏览器样式带到同一点的"Reset CSS" (like Eric Meyer’s)

相关:What is the easiest or fastest way to make CSS render the same in all browsers

相关问题