[英]Table padding in Internet Explorer
I've noticed that Internet Explorer seems to ignore a table's padding. 我注意到Internet Explorer似乎忽略了表的填充。 I've tested version 7, 8 and 9.
我已经测试了版本7、8和9。
What is the best workaround? 最好的解决方法是什么? I prefer a workaround that's based purely on CSS than one that involves wrapping tables in
<div>
s or messing with tags in general. 我更喜欢一种完全基于CSS的解决方法,而不是将表包装在
<div>
或将标签弄乱的解决方法。
I have found that this actually works as a fallback for flex box in ie9. 我发现这实际上可以作为ie9中flex box的后备。 And while the original question has nothing to do with CSS flex,and this is probably a repeat, it solved an issue for us, so I will mention it here and hope it helps others.
尽管最初的问题与CSS flex无关,并且可能是重复的,但它为我们解决了一个问题,因此我在这里将其提及并希望对其他人有所帮助。 flex:
.selector { display: flex; }
flex:
.selector { display: flex; }
.selector { display: flex; }
and no flex fallback: .no-flexbox .selector { display: table-cell; padding : 25%; }
.selector { display: flex; }
并且没有flex后备: .no-flexbox .selector { display: table-cell; padding : 25%; }
.no-flexbox .selector { display: table-cell; padding : 25%; }
Try this: 尝试这个:
td
{
display: table-cell;
padding: 30px;
border: 1px solid #000000;
}
As seen on jsfiddle . 如jsfiddle所示 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.