Internet Explorer 中的溢出表错误

发布于 2024-10-17 09:37:23 字数 454 浏览 3 评论 0原文

简短版本:设置为 width:100% 的 Internet Explorer 表会脱离其父元素。

我知道这是一个古老且已知的错误,但我用谷歌搜索了一遍,但没有找到任何答案。我刚刚发现了其他问题,但都没有答案。我发现的一些“解决方案”不起作用。也许我没有仔细寻找或寻找正确的东西,但我问是因为我无法适应它,所以不要因为我没有先寻找而责怪我。不管怎样,我确信你们大多数人都遇到过我遇到的问题,如果不是问题,那么就完全是浏览器的问题:Internet Explorer。那个你总是想避开却不可避免地会遇到的人。所以,表格宽度错误。默认情况下,表格非常拥挤并且相当小,它们的宽度由行中内容的大小设置。所以,当然,我使用了 width:100% 来让它延伸到它的父 div 上。毫不奇怪,IE 认为这意味着它应该脱离其父级并成为页面的 100%。因此,我尝试了许多我个人知道的解决方案,但似乎都不起作用。我知道有一个非常简单的解决方案,但我就是找不到。有遇到这个问题的人可以帮我一下吗?

SHORT VERSION: Internet Explorer tables set to width:100% bust out of their parent elements.

I know this is an old and known bug, but I've Googled it and Googled it and haven't found any answers. I've just found other questions, all without answers. A few "solutions" I found didn't work. Maybe I'm not looking hard enough or for the right thing, but I'm asking because I just can't fit it, so don't flame me for not looking first. Anyway, the problem I'm having is one I'm sure most of you have had, and if not the problem then just the browser altogether: Internet Explorer. That one person you always try to avoid but inevitably run in to. So, the table width bug. By default, tables are pretty crammed up and rather small, their width set by the size of the content in the rows. So, of course, I used width:100% to make it stretch out across its parent div. To no surprise, IE thinks that means it should bust out of its parent and be 100% of the page. So, I've tried a number of solutions I know personally, however none seem to work. I know there's a very simple solution out there, but I just can't find it. Could someone who's had this problem please lend me a hand?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

给不了的爱 2024-10-24 09:37:23

尝试一下怎么样:

#el { margin-right:-1px; }

What about trying:

#el { margin-right:-1px; }
怂人 2024-10-24 09:37:23

有点晚了,但可能得到了答案:)我在 IE 11 中遇到了这个问题(请不要在您的应用程序中支持该问题 - 完全浪费时间)并通过此修复

table {
    table-layout: fixed;
}

尝试一下,让我知道它是否适合您

更新:它使列宽固定

Bit late, but probably got an answer :) I faced this problem in IE 11 (please do not support that in your apps - total time waste) and fixed by this

table {
    table-layout: fixed;
}

Give it a try and let me know if it works well for you

Update: It makes column widths fixed

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文