question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot add a border-radius to the header of b-table

See original GitHub issue

Describe the bug

I have applied a border-radius: 15px to my b-table, but only to bottom corners are rounded. I have the impression that the top corners are covered by the thead but even if i apply the border-radius to the thead it doesn’t change.

Here is my code VueJs code:

  <b-col id="reportstab_block">
    <b-table :items="reports" :fields="fields" thead-class="thead-block">
    </b-table>
  </b-col>
</template>

And my Sass stylesheet:

#reportstab_block
  .table
    box-shadow: 0px 5px 5px $light_blue;
    border-radius: 15px;
    .thead-block
      background-color: $red
      tr
        th
          color: $light

Here is the result: Capture_vuejs_bug

Expected behavior

Rounded corners on all the corners of the b-table.

Versions

Libraries:

  • BootstrapVue: 2.9.0
  • Bootstrap: 4.4.1
  • Vue: 2.6.11

Environment:

  • OS: Windows
  • Browser: Mozilla Firefox
  • Version: 74.0.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
b0rdjackcommented, Apr 10, 2020

I tried many combinations and got it worked by doing this:

.thead-block
  tr
    th
      background-color: $red
      border: none
      color: $light
    th:first-child
      border-top-left-radius: 15px
    th:last-child
      border-top-right-radius: 15px

Thanks for your help 😃

0reactions
tmorehousecommented, Apr 6, 2020

try targeting your background colors to the <th> cells, or <tr>, perhaps?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Table's border-radius does not function as expected
To use border radius I have a border radius of 20px in the table, and then put the border radius on ...
Read more >
Table with CSS3 Border Radius - CodePen
table { border-collapse: collapse; border-radius: 1em; overflow: hidden; }. Entry Header 1, Entry Header 2, Entry Header 3, Entry Header 4.
Read more >
border-radius - CSS: Cascading Style Sheets - MDN Web Docs
The border-radius CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, ......
Read more >
CSS Rounded Table Corners | UnusedCSS
If you are only rounding the corners of the whole table, a border-radius will get the job done. But if you need to...
Read more >
border-radius - CSS-Tricks
You can give any element “rounded corners” by applying a border-radius through CSS. You'll only notice if there is a color change involved....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found