-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Card tables #25193
Card tables #25193
Conversation
This feature will break a table including merged ( <table class="table table-bordered">
<thead>
<tr><th>Name</th><th>Data</th></tr>
</thead>
<tbody>
<tr><td rowspan="3">Name 01</td><td>001</td></tr>
<tr><td>002</td></tr>
<tr><td>003</td></tr>
<tr><td rowspan="3">Name 02</td><td>001</td></tr>
<tr><td>002</td></tr>
<tr><td>003</td></tr>
</tbody>
</table> |
Hmm good point @ysds. |
Hmmm, that case is not fixable with utility-classes either. The only thing I could think of is adding a new class to the fields that are not aligned. |
@mdo, is it an option to continue with this with a warning about the |
How about adding this as an optional class like |
@ysds, where would you add this class and what would this exactly do? Can you maybe provide a demo? |
|
I am worried that adding new features (or changing padding/margin) to existing class ( |
Good feedback, @ysds! I've now changed the selector to Also added an example of the responsive table in the demo: https://codepen.io/MartijnCuppens/pen/JMyOgv |
When not using a .card-table {
&:first-child th {
border-top: 0;
}
} Working example: https://codepen.io/royklutman/pen/jQMPda (first card). |
@royklutman, good point, but the solution is not that simple, we'll also need to cover these cases:
So in the end we'll end up with this css: .card > .card-table:first-child > thead:first-child tr:first-child th,
.card > .card-table:first-child > tbody:first-child tr:first-child th,
.card > .card-table:first-child > tbody:first-child tr:first-child td,
.card > .table-responsive:first-child .card-table > thead:first-child tr:first-child th,
.card > .table-responsive:first-child .card-table > tbody:first-child tr:first-child th,
.card > .table-responsive:first-child .card-table > tbody:first-child tr:first-child td {
border-top: none;
} I'm not sure if it's worth adding this much CSS for that case, especially when the top border can be removed with utility classes. |
efe81bd
to
9d7504d
Compare
9d7504d
to
2e5f8d4
Compare
@MartijnCuppens Would you be okay with holding off on this until v5 maybe? It looks great overall, but I'm wondering if there's something we can do in the default component |
Changing the default paddings would indeed be a better option, I'll remove this from |
Gonna close this, syncing the paddings in |
@MartijnCuppens @mdo Will you reconsider this feature now that Bootstrap 5 is out? |
Fixes #25057
Demo: https://deploy-preview-25193--twbs-bootstrap4.netlify.com/docs/4.1/components/card/#tables