How to remove the horizontal border of a table in boot

How to remove the horizontal border of a table using bootstrap? I want to keep only the 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>
+5
source share
4 answers

Never use! Important as it is bad practice. Solution for your question

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

All horizontal borders disappeared, and only vertical borders remained.

+9
source

Try the following:

table.table.table-bordered td{
    border: 0 none !important;
}

This removes all borders from the table.

0
source

.table.table-bordered.vertical,
.table.table-bordered.vertical td,
.table.table-bordered.vertical th{
  border-top: 0px solid white !important;
  border-bottom: 0px solid white !important;
    }
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>

</head>
  
<body>
<div class="container">
<table class="table table-bordered vertical">
    <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>
</div>


</body>
</html>

, ? , , . , , th td.

Note. Bad practice replacing original behavior. Therefore, I rather expand it. It table table-bordered verticalwill now show vertical borders, and table table-borderedwill display the original version.

thank

0
source

Write this:

table.table td, table.table th, table.table tr{
   border:none !important;
}
0
source

Source: https://habr.com/ru/post/1583995/


All Articles