bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

v5.3 regression: table clips container's rounded border

Open grantbdev opened this issue 4 months ago • 3 comments

Prerequisites

Describe the issue

When upgrading from Bootstrap v5.2 to v5.3, tables inside a container with rounded borders (such as the card component) have a piece visibly missing from the rounded borders at the top where it did not do so in previous versions of Bootstrap. The difference is subtle so you may have to zoom into the corner to see it on the screenshots.

Reduced test cases

v5.2 (expected appearance): https://codepen.io/Grant-Bourque/pen/bNVOLVQ

Image

v5.3 (unexpected appearance, same on latest version): https://codepen.io/Grant-Bourque/pen/xbwmYRg

Image

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Firefox

What version of Bootstrap are you using?

v5.3.8

grantbdev avatar Sep 03 '25 22:09 grantbdev

By default, Bootstrap tables now (recently) have a solid background (white in your example), which covers rounded corners on a parent wrapper. This was also noticeable in v5.2 with striped tables, where the stripes extended over the wrapper’s border radius (e.g. <table class="table table-borderless table-striped mb-0">):

Image

I'm not entirely sure if this is something we can fix as the solid background fixes other issues for table, or maybe at least try to provide a workaround.

Depending on your use case, one workaround could be to make the table background transparent and let the wrapper provide the background:

<div class="border rounded">
  <table class="table table-borderless mb-0" style="--bs-table-bg: transparent">
    ...
  </table>
</div>

julien-deramond avatar Sep 06 '25 20:09 julien-deramond

@julien-deramond Thanks for looking into it! I noticed that adding table-responsive to the parent wrapper also fixes the border clipping, but good to know that I can tweak the table background if needed.

grantbdev avatar Sep 07 '25 15:09 grantbdev

I noticed that adding table-responsive to the parent wrapper also fixes the border clipping

Interesting! So you can use .overflow-auto instead of .table-responsive:

<div class="border rounded overflow-auto">
    <table class="table table-borderless table-striped mb-0">
    ...
    </table>
</div>

julien-deramond avatar Sep 07 '25 17:09 julien-deramond