css - Bootstrap 表。如何从表格中删除所有边框?

标签 css twitter-bootstrap twitter-bootstrap-3 bootstrap-table

如何从 bootstrap table 中删除所有(尤其是外部的)边框?这是一个没有内部边框的表格:

HTML

<style>
    .table th, .table td { 
        border-top: none !important;
        border-left: none !important;
    }
</style>
<div class="row">
    <div class="col-xs-1"></div>
    <div class="col-xs-10">
        <br/>
        <table data-toggle="table" data-striped="true">
            <thead>
            <tr>
                <th>Column 1</th>
                <th>Column 2</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>A</td>
                <td>B</td>
            </tr>
            <tr>
                <td>C</td>
                <td>D</td>
            </tr>
            <tr>
                <td>E</td>
                <td>F</td>
            </tr>
            </tbody>
        </table>
    </div>    
    <div class="col-xs-1"></div>
</row>   

http://jsfiddle.net/sba7wkvb/1/

需要覆盖哪些 CSS 样式才能删除所有边框?

最佳答案

在这种情况下,您需要设置边框表格下方和边框周围-表格标题r、表格数据表格容器全部为0px,以完全摆脱所有边界。

.table {
    border-bottom:0px !important;
}
.table th, .table td {
    border: 1px !important;
}
.fixed-table-container {
    border:0px !important;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.css" rel="stylesheet"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.js"></script>

<div class="row">
    <div class="col-xs-1"></div>
    <div class="col-xs-10">
        <br/>
        <table data-toggle="table" data-striped="true">
            <thead>
            <tr>
                <th>Column 1</th>
                <th>Column 2</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>A</td>
                <td>B</td>
            </tr>
            <tr>
                <td>C</td>
                <td>D</td>
            </tr>
            <tr>
                <td>E</td>
                <td>F</td>
            </tr>
            </tbody>
        </table>
    </div>    
    <div class="col-xs-1"></div>

关于css - Bootstrap 表。如何从表格中删除所有边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29874274/

相关文章:

javascript - Twitter Bootstrap 的 Tab 插件中的 "data-api"是什么意思

css - 在 bootstrap 中使用 container-fluid 导致水平滚动条

css - 使用 Bootstrap col-md-4 网格,但它会中断

html - 为什么使用输入组会破坏 Bootstrap 中的基线对齐?

node.js - 为什么 Git 会自动忽略大多数 Node 文件?

html - 页脚和背景图像之间的大空白

javascript - 如何在猫头鹰旋转木马的屏幕上显示上一个和下一个 slider ?

javascript - 调整浏览器窗口大小时不显示响应式导航栏

php - HTML 表上的 CSS 中断使用 PHP 发送电子邮件

javascript - 当用户滚动到一个元素时,如何删除它的不透明度?