边框崩溃在IE10中不起作用 [英] border collapse not working in IE10

查看:66
本文介绍了边框崩溃在IE10中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人遇到过无法在IE10中正常工作的表格的边框折叠的解决方案?

Has anyone come across a solution for border collapse on tables not working in IE10?

我在需要使用的网站上都有表格,它们在所有其他浏览器中都可以正常显示,但是自IE 10以来,边框变得很粗.

I have tables on web sites used where needed, and they display fine in all other browsers, but Since IE 10 the borders are way to thick.

任何帮助表示赞赏

推荐答案

上述问题可能已有几个月的历史,但是今天我遇到了同样的问题,并认为我至少可以提供一些可能的解决方案,即使它是不是理想的人.

Above question may be a few months old, but today I've ran into the same problem and thought I could at least provide some possible solution, even though it's not an ideal one.

如问题所描述,即使没有边界加起来,使用border-collapse也会在IE10中导致较粗的边界.当不包括边框折叠时,边框宽度将保持其正常厚度.但是,忽略边界宽度会导致单元之间存在间隔.

As the problem describes, using border-collapse causes a thick border in IE10, even though there are no borders that would add up. When leaving out border-collapse, the border-width remains its normal thickness. However, leaving out border-width results in space between cells.

获得所需结果的唯一可能选择是根本不使用边界折叠.相反,请使用"border-spacing:0px;"摆脱单元格之间的空间并非常明确地定义边界.

The only possible alternative to get the desired result is to not use border-collapse at all. Instead, use 'border-spacing:0px;' to get rid of the spaces between cells and define borders very specifically.

示例:

table{
    border-collapse: collapse;
}
table td{
    border: 1px solid black;
}

将成为

table{
    border-spacing: 0px;
    border-top: 1px solid black;
    border-right: 1px solid black;
}
table td{
    border-left: 1px solid black;
    border-bottom: 1px solid black;
}

就像我之前说过的那样:这并不理想,但至少可以提供理想的跨浏览器结果.

Like I said before: it's not ideal, but at least it would give the desired cross-browser result.

注意:仅当使用1px的边框宽度时,才会出现IE10中的问题.当使用border-collapse:collapse;时,1px的边框宽度将导致2px.在IE10中.当使用更高的边框宽度时,结果将是正常的.

Note: the problem in IE10 only occurs when using a border-width of 1px. A border-width of 1px will result in 2px when using border-collapse:collapse; in IE10. When using a higher border-width, the result will be normal.

这篇关于边框崩溃在IE10中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆