Rounded tables in Twitter Bootstrap 3

前端 未结 10 835
清酒与你
清酒与你 2020-12-24 05:02

Bootstrap 3 has dropped rounded corners on tables. Which styles should I apply to get them back when I apply the .table-bordered class, please?

10条回答
  •  误落风尘
    2020-12-24 05:39

    The answer above on wrapping the table with a panel (

    ) seems to work the best.

    However, as mentioned in the comments, you do need to remove the top border on the table.

    I used this SCSS to do this, so thought I would share:

    // remove extra top border on tables wrapped in a panel
    .panel {
      & > .table-responsive > .table.table-bordered, & > .table.table-bordered {
        & > tbody:first-child, & > thead:first-child {
          & > tr:first-child {
            td, th {
              border-top: none;
            }
          }
        }
      }
    }
    

提交回复
热议问题