表格边框未显示

时间:2015-06-25 02:52:36

标签: html css less

我正在尝试为桌子设置样式并且边框没有显示出来。这在我之前从未发生过,所以我不知道该怎么做。

这是我的表:

<table class="table">
  <thead>
    <tr>
      <th>Dessert (100g serving)</th>
      <th>Calories</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Dessert (100g serving)</td>
      <td>Calories</td>
    </tr>
  </tbody>
</table>

这是我的不足之处:

@dark-text: rgba(0,0,0,0.87);
@dark-text-secondary: rgba(0,0,0,0.54);
@dark-text-disabled: rgba(0,0,0,0.26);

.table {
    z-index: 10;

    thead {
        tr {
            border-bottom: 3px solid @dark-text-disabled;
            z-index: 10;

            th {
                color: @dark-text-secondary;
                z-index: 10;
            }
        }
    }

    tbody {
        tr {
            border-bottom: 3px solid @dark-text-disabled;
            z-index: 10;

            td {
                z-index: 10;
            }
        }
    }
}

http://codepen.io/anon/pen/JdOaVO

1 个答案:

答案 0 :(得分:1)

border-bottom规则移至thtd代码,或使用collapsing border modelborder-collapse: collapse;)代替.table

.table {
    border-collapse: collapse;
}

http://codepen.io/anon/pen/BNmOgg