Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove the first line of a twitter bootstrap table

Tags:

As you all know when you use Twitter Bootstrap to get a table you get a result like this: enter image description here

Would it be possible o remove the very first line of the table, the one above "Abos Girolamo"? Thanks

UPDATE: Here is the code of the table:

<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> 
like image 539
Dharma Dude Avatar asked Jan 28 '14 14:01

Dharma Dude


2 Answers

.table > tbody > tr:first-child > td {     border: none; } 

@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;  }
<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>
like image 122
Adrift Avatar answered Oct 01 '22 07:10

Adrift


For those who found this question via Google...

Bootstrap tables assume you will use a thead in your markup, which is why that top line is present. If you have a mix of tables that include a header and don't include a header, you can use the following CSS to style them correctly.

/* 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; } 

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

like image 41
Colin Miller Avatar answered Oct 01 '22 05:10

Colin Miller