Created
May 21, 2024 03:00
-
-
Save bintangmuh/94010799dd6226da1ec0d2151473913d to your computer and use it in GitHub Desktop.
Fixed first coloumn when table scroll horizontaly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* source: https://dev.to/nicolaserny/table-with-a-fixed-first-column-2c5b */ | |
/* work with bootstrap table css */ | |
/* make the first coloumn of the (row head and body) sticky */ | |
.table-sticky>tr>th:first-child,.table-sticky>tr>td:first-child { | |
position: sticky; | |
left: 0; | |
background-color: inherit; | |
} | |
/* change the background color please, otherwise it will transparent */ | |
.table-striped .table-sticky>tr:nth-of-type(odd) td:first-child { | |
background-color: rgba(242, 242, 242); | |
} | |
.table-striped .table-sticky>tr:nth-of-type(even) td:first-child { | |
background-color: white; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment