Remove row lines in twitter bootstrap

前端 未结 6 1200
予麋鹿
予麋鹿 2021-01-30 08:12

I\'m using twitter bootstrap for some web app I\'m forced to do (I\'m not a web developer) and I can\'t find a way to disable the row lines for tables.

As you can see fr

相关标签:
6条回答
  • 2021-01-30 08:36

    bootstrap.min.css is more specific than your own stylesheet if you just use .table td. So use this instead:

    .table>tbody>tr>th, .table>tbody>tr>td {
        border-top: none;
    }
    
    0 讨论(0)
  • 2021-01-30 08:36

    The other way around, if you have problems ADDING the lines to your panel dont forget to add the to your TABLE. By default (http://getbootstrap.com/components/#panels), it is suppose to add the line but It helped me to add the tag so now the row lines are shown.

    The following example "probably" wont display the lines between rows:

    <div class="panel panel-default">
        <!-- Default panel contents -->
        <div class="panel-heading">Panel heading</div>
        <!-- Table -->
        <table class="table">
            <tr><td> Hi 1! </td></tr>
            <tr><td> Hi 2! </td></tr>
        </table>
    </div>
    

    The following example WILL display the lines between rows:

    <div class="panel panel-default">
        <!-- Default panel contents -->
        <div class="panel-heading">Panel heading</div>
        <!-- Table -->
        <table class="table">
            <thead></thead>
            <tr><td> Hi 1! </td></tr>
            <tr><td> Hi 2! </td></tr>
        </table>
    </div>
    
    0 讨论(0)
  • 2021-01-30 08:41

    In Bootstrap 3 I've added a table-no-border class

    .table-no-border>thead>tr>th, 
    .table-no-border>tbody>tr>th, 
    .table-no-border>tfoot>tr>th, 
    .table-no-border>thead>tr>td, 
    .table-no-border>tbody>tr>td, 
    .table-no-border>tfoot>tr>td {
      border-top: none; 
    }
    
    0 讨论(0)
  • 2021-01-30 08:41

    This is what worked for me..

    .table-no-border>thead>tr>th, 
    .table-no-border>tbody>tr>th, 
    .table-no-border>tfoot>tr>th, 
    .table-no-border>thead>tr>td, 
    .table-no-border>tbody>tr>td, 
    .table-no-border>tfoot>tr>td,
    .table-no-border>tbody,
    .table-no-border>thead,
    .table-no-border>tfoot{
      border-top: none !important; 
      border-bottom: none !important; 
    }
    

    Had to whip out the !important to make it stick.

    0 讨论(0)
  • 2021-01-30 08:50

    Got the same question from a friend. My suggestion which does not require !Important looks like this: I add a custom class "no-border" which can be added to the bootstrap table.

    .table.no-border tr td, .table.no-border tr th {
      border-width: 0;
    }
    

    You can see my go at a solution here

    0 讨论(0)
  • 2021-01-30 09:01

    Add this to your main CSS:

    table td {
        border-top: none !important;
    }
    

    Use this for newer versions of bootstrap:

    .table th, .table td { 
         border-top: none !important; 
     }
    
    0 讨论(0)
提交回复
热议问题