1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-30 16:50:00 +02:00

Add zebra striping for table columns

Co-Authored-By: Macallan Camara <44030647+Macinto5h@users.noreply.github.com>
Co-Authored-By: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
Macinto5h
2021-03-14 15:07:24 -04:00
committed by Mark Otto
parent 43a9216a7f
commit d2986daa12
3 changed files with 23 additions and 3 deletions

View File

@@ -103,6 +103,7 @@
//
// Default zebra-stripe styles (alternating gray and transparent backgrounds)
// For rows
.table-striped {
> tbody > tr:nth-of-type(#{$table-striped-order}) > * {
--#{$variable-prefix}table-accent-bg: var(--#{$variable-prefix}table-striped-bg);
@@ -110,6 +111,14 @@
}
}
// For columns
.table-striped-columns {
> :not(caption) > tr > :nth-child(#{$table-striped-columns-order}) {
--#{$variable-prefix}table-accent-bg: var(--#{$variable-prefix}table-striped-bg);
color: var(--#{$variable-prefix}table-striped-color);
}
}
// Active table
//
// The `.table-active` class can be added to highlight rows or cells

View File

@@ -676,6 +676,7 @@ $table-border-width: $border-width !default;
$table-border-color: $border-color !default;
$table-striped-order: odd !default;
$table-striped-columns-order: even !default;
$table-group-separator-color: currentColor !default;