表格在 ie7 中不显示
由于某种原因,我的表格不会显示在 IE7 中。 一个示例表格如下所示:
<table class="stringingTable">
<tbody>
<tr>
<td class="selected">.</td>
<td>,</td>
<td>and</td>
<td>also</td>
<td>but</td>
<td>however</td>
<td>whereas</td>
</tr>
</tbody>
</table>
相关的 css 如下所示:
stringingTable {
position: relative;
width: 70px;
height: 30px;
background: #9A2F00;
text-align: center;
font-size: 0.8em;
line-height: 1em;
cursor: pointer;
cursor: hand;
}
.stringingTable td.selected {
display: table-cell;
}
.stringingTable td {
word-wrap: break-word;
max-width: 70px;
display: none;
}
该表格在所有现代浏览器中都显示良好,但这是 NI 教师的网站(他们都使用 IE7,因为他们使用 C2k)
For some reason my tables won't show up in IE7.
An example table looks like this:
<table class="stringingTable">
<tbody>
<tr>
<td class="selected">.</td>
<td>,</td>
<td>and</td>
<td>also</td>
<td>but</td>
<td>however</td>
<td>whereas</td>
</tr>
</tbody>
</table>
The relevant css looks like this:
stringingTable {
position: relative;
width: 70px;
height: 30px;
background: #9A2F00;
text-align: center;
font-size: 0.8em;
line-height: 1em;
cursor: pointer;
cursor: hand;
}
.stringingTable td.selected {
display: table-cell;
}
.stringingTable td {
word-wrap: break-word;
max-width: 70px;
display: none;
}
The table shows up fine in all modern browsers but this is a website for teachers in NI (who all use IE7 as they use C2k)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Internet Explorer 8 以下版本不支持 CSS 表格显示属性,包括
table
、inline-table
以及table-*
的所有属性>。不幸的是,通过将这些单元格设置为display: none
,您将无法在不更改表格外观的情况下重新显示它们(因为您无法将它们设置回表格单元格) 。我不知道这对您的具体情况是否有帮助,但您可以尝试使用
visibility:hidden
和visibility:visible
。Internet Explorer versions less than 8 do not support the CSS table display properties, which include
table
,inline-table
, and all properties oftable-*
. Unfortunately by setting those cells asdisplay: none
, you will not be able to redisplay them without altering the table's appearance (as you can't set them back to table cells).I don't know if it will be helpful in your specific case, but you can try playing with
visibility: hidden
andvisibility: visible
instead.您对所有
TD
使用display: none;
,因此您隐藏了所有内容。如果我不删除display: none
,它也不会显示在 Chrome 中。You are using
display: none;
for allTD
s, so you hide everything. It doesn't show up in Chrome either for me if I don't remove thedisplay: none
.