I would like to remove the bootstrap table-bordered horizontal line and keep the vertical line.
I have tried many solutions and done many of the research but I still cannot find the solution.
<div class="container">
<div class="row">
<div class="col-md-12">
<table class="table table-bordered">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
</thead>
<tbody>
<tr>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<td>Otto</td>
<td>@TwBootstrap</td>
</tr>
<tr>
<td>Thornton</td>
<td>@fat</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
Just add these css rules in your css file (remove the border from the td
and add again to the right side):
.table-bordered td {border: none !important; border-right: solid 1px #ccc !important;}
.table-bordered td {
border: none !important;
border-right: solid 1px #ccc !important;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row">
<div class="col-md-12">
<table class="table table-bordered">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
</thead>
<tbody>
<tr>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<td>Otto</td>
<td>@TwBootstrap</td>
</tr>
<tr>
<td>Thornton</td>
<td>@fat</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
One more snippet to remove the border from thead
also...
.table-bordered td,
.table-bordered th {
border: none !important;
border-right: solid 1px #ccc !important;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row">
<div class="col-md-12">
<table class="table table-bordered">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
</thead>
<tbody>
<tr>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<td>Otto</td>
<td>@TwBootstrap</td>
</tr>
<tr>
<td>Thornton</td>
<td>@fat</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With