使用rowspan在表中绝对居中的奇怪IE位置

问题描述 投票:0回答:1

使用rowspan时,我在Internet Explorer的表中居中项目时遇到问题。 qazxsw poi

我使用的位置绝对前50%,转换:translateY(-50%)到中心。但结果很奇怪。这只发生在带有rowspan的IE上。任何想法为什么以及如何解决它?

enter image description here
th, td {
  position: relative;
  border: 1px solid red;
  padding: 0 25px;
}

.sortable {
  background-image:url('https://imageog.flaticon.com/icons/png/512/25/25243.png?size=1200x630f&pad=10,10,10,10&ext=png&bg=FFFFFFFF');
  background-size: contain;
  background-repeat: no-repeat;
  display: inline-block;
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  height: 10px;
  width: 10px;
}
html css internet-explorer
1个回答
0
投票

您的代码在IE 10.0上与我合作,检查您的IE版本,因为IE 9.0使用-ms-前缀开始支持转换CSS属性。 <table> <tr> <th rowspan=2> first <span class="sortable"></span> </th> <th rowspan=2>second</th> <th colspan=2>first</th> </tr> <tr> <th>one</th> <th>two</th> </tr> </table>

W3Schools Ref

© www.soinside.com 2019 - 2024. All rights reserved.