Skip to content

A .table-striped inside a .card ignores border-radius on odd rows #126

Closed

Description

@casually-creative

Current Behavior 😯

When you put a .table-striped inside a .card, and you have an odd row at the top or bottom, the top or bottom border radius respectively of the card gets ignored. Giving you a sharp corner.

Expected Behavior 🤔

The card keeps its border radius.

Steps to Reproduce 🕹

Most basic:

<div class="card">
    <table class="table table-striped">
        <tbody>
            <tr><td>Something 1</td></tr>
            <tr><td>Something 2</td></tr>
        </tbody>
    </table>
</div>

Your Environment 🌎

  • Browser: Chrome 102.0.5005.63
  • OS: Windows 10
  • Screen size: no impact

Screenshots 📷

The phenomenon can be seen on the adminkit live demo page (Striped Rows section: https://demo.adminkit.io/tables-bootstrap.html
Here is a gif of the demo page (look at bottom radiuses):
adminkit-card-table-border-bug

For me it looks like this (look at top radiuses):

image

Activity

  1. casually-creative commented on May 29, 2022

    @casually-creative
    Author

    Currently fixed it with custom scss:

    .card
    {
        & > table,
        & > .table
        {
            overflow: hidden;
            border-radius: inherit;
        }
    }

    Looking for an official fix in the kit though. I'd imagine the overflow fix is not something everyone would prefer.

  2. self-assigned this
    on May 29, 2022
  3. paullaros commented on Aug 9, 2022

    @paullaros
    Contributor

    Thanks! We came up with the following solution, which will be part of the next version of AdminKit:

    .card > .table > tbody {
      tr:last-child td:first-child,
      tr:last-child th:first-child {
        border-bottom-left-radius: $card-border-radius;
      }
      tr:last-child td:last-child,
      tr:last-child th:last-child {
        border-bottom-right-radius: $card-border-radius;
      }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions