IE8表消失在border-top

时间:2010-02-01 19:12:24

标签: html css internet-explorer-8 html-table

嗨我有一张桌面边框顶部设置为2px。这适用于IE8以外的所有浏览器。 CSS:

<style type="text/css">
.mytable {
    border-collapse: collapse;
    border: 0;
    border-top: 2px solid #43848C;
    width: 300px;
    margin:0 2em 1em;
    border-bottom: 1px solid #72afb6;
}
    .mytable tr {
        border-color: #72afb6;
        border-width: 1px 0;
        border-style: solid;
    }
        .mytable td {
            margin: 0; 
            padding: 8px 10px 7px 10px;
            border: 0 solid transparent;
            border-bottom: 1px solid #72afb6;
            vertical-align: middle;
            width: auto;        
        }
        .mytable .th {
            background-color: #f0f7f5;
            color: #42828b;
            font-weight: bold;
            font-variant: normal;
            font-size: 14px;
            vertical-align:top;
        }
</style>

HTML:

<table class="mytable">
  <tbody>
    <tr>
      <td class="th">Heading 1</td>
      <td class="th">Heading 2</td>
    </tr>
    <tr>
      <td>Lorem ipsum</td>
      <td>Lorem ipsum</td>
    </tr>
    <tr>
      <td>Lorem ipsum</td>
      <td>Lorem ipsum</td>
    </tr>
    <tr>
      <td>Lorem ipsum</td>
      <td>Lorem ipsum</td>
    </tr>
    <tr>
      <td>Lorem ipsum</td>
      <td>Lorem ipsum</td>
    </tr>
    <tr>
      <td>Lorem ipsum</td>
      <td>Lorem ipsum</td>
    </tr>
  </tbody>
</table>

谢谢! 德文

1 个答案:

答案 0 :(得分:1)

您提供的代码适用于我:http://jsbin.com/alaba/

其他地方一定是个问题...... :(