我需要隐藏所有行,然后显示选定的行。我的代码如下。在Internet Explorer以外的所有浏览器中,此功能都可以正常工作。在IE中,所有行都被隐藏,没有任何显示。
任何帮助将不胜感激。
这是表定义的代码
<table id="tableID">
<thead>
<tr>
<th>Product</th>
<th>Price</th>
<th>Destination</th>
<th>Updated on</th>
</tr>
</thead>
<tbody>
<tr class="parent">
<td>Oranges</td>
<td>100</td>
<td>22/10</td>
</tr>
<tr>
<td></td>
<td>120</td>
<td>City 1</td>
<td>22/10</td>
</tr>
</tbody>
这是CSS
#tableID tbody tr {
display : none;
}
#tableID tr.parent {
display : table-row;
color: blue;
}
您的IE版本可能不支持该display: table-row
属性。因此,与其尝试display:block
#tableID tr.parent {
display : block;
color: blue;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句