删除twitter bootstrap表的第一行

Dha*_*ude 20 html html-table twitter-bootstrap

众所周知,当您使用Twitter Bootstrap获取表格时,您会得到如下结果: 在此输入图像描述

是否有可能删除表格的第一行,即"Abos Girolamo"上面的那一行?谢谢

更新:这是表的代码:

<table class="table table-no-border">
    <tbody>

      <tr>

        <td>Abos Girolamo</td>
      </tr>

      <tr>

        <td>Aboulker Isabelle</td>
      </tr>

      <tr>

        <td>Adam Adolphe</td>
      </tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

adr*_*ift 30

.table > tbody > tr:first-child > td {
    border: none;
}
Run Code Online (Sandbox Code Playgroud)

@import url('http://getbootstrap.com/dist/css/bootstrap.css');

table {
    margin-top: 50px;
}

.table > thead > tr:first-child > td, 
.table > tbody > tr:first-child > td {
    border: none;
}
Run Code Online (Sandbox Code Playgroud)
<table class="table table-no-border">
    <tbody>

      <tr>

        <td>Abos Girolamo</td>
      </tr>

      <tr>

        <td>Aboulker Isabelle</td>
      </tr>

      <tr>

        <td>Adam Adolphe</td>
      </tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

  • 对于将来的访问者,不要忘记删除第一个**的边框,.table&gt; tbody&gt; tr:first-child&gt; th {border:none; }`(如果需要) (2认同)

小智 6

对于那些通过谷歌发现这个问题的人......

Bootstrap 表假设您将thead在标记中使用 a ,这就是为什么会出现顶行。如果您有包含标题和不包含标题的混合表格,您可以使用以下 CSS 正确设置它们的样式。

/* Remove the top border when a table is missing the header */
.table > tbody > tr:first-child > td {
    border: none;
}

/* Include the border when there's a header */
.table > thead + tbody > tr:first-child > td {
    border-top: 1px solid #ddd;
}
Run Code Online (Sandbox Code Playgroud)

http://jsfiddle.net/colinjmiller93/fwsmpu5u/1/