首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CSS:更改表头的边框颜色

问CSS:更改表头的边框颜色
EN

Stack Overflow用户
提问于 2019-06-05 22:42:12
回答 1查看 1.1K关注 0票数 0

我只是想问一下如何更改表头外部的边框颜色。表头之间的边框应该保持白色。我已经做了几次更改,但是默认的灰色似乎没有改变。下面是我的代码:

​

代码语言:javascript
复制
.table th {
  background-color: #3886BE;
  color: #ffffff;
  text-align: center;
  vertical-align: middle;
}
代码语言:javascript
复制
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="table-responsive" id="query_result" style="margin-left:10px;margin-right:10px;">

  <form>
    <table class="table table-bordered table-responsive">
      <tr>
        <th>No.</th>
        <th>Details</th>
        <th>S.O.</th>
        <th>Client Name</th>
        <th>Company</th>
        <th>Service Avail</th>
        <th>Category</th>
        <th>Received</th>
        <th>Completion</th>
        <th>Remaining</th>
        <th>Timeline</th>
        <th>Status</th>
      </tr>
    </table>
  </form>
</div>

​

你可以查看下面的图片作为参考。我在那里留下了一些标题,以了解更多细节。enter image description here

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-06-05 23:06:41

给你,巴迪:)

​

代码语言:javascript
复制
.table th {
  background-color: #3886BE;
  color: #ffffff;
  text-align: center;
  vertical-align: middle;
}
.table-bordered td, .table-bordered th {
    border: 1px solid #3886BE !important;
border-left: 1px solid #fff !important;
    border-right: 1px solid #fff !important;
}
.table-bordered {
    border: 0 !important;
}
table.table.table-bordered.table-responsive {
    margin-top: 10px;
}
代码语言:javascript
复制
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="table-responsive" id="query_result" style="margin-left:10px;margin-right:10px;">

  <form>
    <table class="table table-bordered table-responsive">
      <tr>
        <th>No.</th>
        <th>Details</th>
        <th>S.O.</th>
        <th>Client Name</th>
        <th>Company</th>
      </tr>
    </table>
  </form>
</div>

​

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56462803

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档