1

我正在使用以下代码来定位 table 。它在 firefox 和 chrome 中显示良好,但表格粘在 internet explorer 9 的左侧边缘,但它应该在右侧。有人可以建议对此代码进行一些修改以在 Internet Explorer 中正确显示吗?

html代码:

<table class="tab1">
 <thead>
<tr>    
<th  scope="col" id="Dimension"><strong>DIMENSIONS</strong></th>
<th  scope="col" id="Feet"><strong>FEET</strong></th>
</tr>

</thead>  
</tbody>
<tr class="disp-Sing-Spc
">  
<th class="color1" scope="col">A (Distance Between Signs)</th>
<th class="color1" scope="col" id="A">100</th>
</tr>
<tr class="disp-Sing-Spc
">
<th class="color2" scope="col">B (Distance Between Signs)</th>
<th class="color2" scope="col" id="B">100</th>
</tr>
<tr class="disp-Sing-Spc
">
<th class="color1" scope="col">C (Distance Between Signs)</th>
<th class="color1" scope="col" id="C">100</th>
</tr>
<tr id="disp-Tpr-Len">
<th class="color2" scope="col">L (Taper Length)</th>
<th class="color2" scope="col" id="Tpr-Len">None</th>
</tr>
<tr class="disp-cn-spc
">
<th class="color1" scope="col">Maximum Taper Channelizing Device Spacing</th>
<th class="color1" scope="col" id="max-taper-dv-spcing">None</th>
</tr>
<tr class="disp-cn-spc
">
<th class="color2" scope="col">Suggested Taper Channelizing Device Spacing</th>
<th class="color2" scope="col" id="Sugg-tpr-dev-spcing">None</th>
</tr>
<tr class="disp-cn-spc
">
<th class="color1" scope="col">Maximum Tangent Channelizing Device Spacing</th>
<th class="color1" scope="col" id="Max-Tgt-dev-Spcing">None</th>
</tr>
<tr class="disp-cn-spc
">
<th class="color2" scope="col">Suggested Tangent Channelizing Device Spacing</th>
<th class="color2" scope="col" id="Sugg-Tgt-dev-Spcing">None</th>
</tr>
<tr>
</tbody>

</table>

CSS 代码:

    .tab1{
border-collapse: collapse;
position: absolute;
right: 2%;
top: 95px;
width: 25%;
background: #EA9949;
}
4

1 回答 1

-1

在我的 IE9 中它看起来不错,但是没有 2% 的右边距。您应该尝试浮动您的 div 并使用固定值。

.tab1{
border-collapse: collapse;
position: absolute;
right: 30px;
float:right;
top: 95px;
width: 300px;
background: #EA9949;
}

顺便说一句,您应该阅读表格并改用 div。

于 2013-01-05T00:55:37.647 回答