【问题标题】:Internet Exporer 11 rendering table improperlyInternet Explorer 11 渲染表不正确
【发布时间】:2016-08-08 19:56:06
【问题描述】:

在我的页面上,我有一个包含一些元素的表格,但它在 Internet Explorer 11 中出现问题。感谢任何帮助

这是它在 VS 中的样子:

在 Chrome 中:

这里是 IE:

我的代码:

    <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>

【问题讨论】:

  • 在table标签上设置最大表格宽度。
  • @Aristos 成功了。谢谢!
  • 好吧,我把它作为一个答案......

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


【解决方案1】:

我首先看到的是IE上的表格是全宽的,其他两个不是。

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

一个快速的解决方案是将桌子上的宽度设置为

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

这样你就不会随意了。

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

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

【讨论】:

    猜你喜欢
    • 2011-10-29
    • 2012-09-10
    • 1970-01-01
    • 1970-01-01
    • 2016-08-19
    • 1970-01-01
    • 1970-01-01
    • 2016-05-22
    • 2018-09-13
    相关资源
    最近更新 更多