Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to remove horizontal border of a table in bootstrap

how to remove horizontal border of a table using bootstrap? I want to keep only vertical border. Here is my code:

<table class="table table-bordered">
    <thead>
        <tr>
            <th>Home</th>
            <th>Client</th>
            <th>Setting</th>
        </tr>   
    </thead>
    <tbody>
        <tr>
            <td>data1</td>
            <td>data2</td>
            <td>data3</td>
        </tr>
        <tr>
            <td>data1</td>
            <td>data2</td>
            <td>data3</td>
        </tr>
        <tr>
            <td>data1</td>
            <td>data2</td>
            <td>data3</td>
        </tr>
    </tbody>
</table>
like image 396
Developer_grt Avatar asked Apr 22 '15 10:04

Developer_grt


1 Answers

Never use !important as it is a bad practice. The solution for your question is

.table-bordered > tbody > tr > td,
.table-bordered > thead > tr > td,
.table-bordered {
    border-bottom: 0;
    border-top: 0;
}

All the horizontal borders are gone and only the vertical borders are left.

like image 145
Saiyam Gambhir Avatar answered Sep 24 '22 14:09

Saiyam Gambhir