Created
July 1, 2016 13:13
-
-
Save zeraphie/2f563d326089f8d2094a848b46e04f84 to your computer and use it in GitHub Desktop.
CSS Only solution to highlighting the current row and column
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
table { | |
float: left; | |
overflow: hidden; | |
position: relative; | |
width: 100%; | |
z-index: 2; | |
} | |
table tr { | |
-webkit-transition: background-color 0.3s; | |
transition: background-color 0.3s; | |
} | |
table td { | |
// Comment this if you want to have the full row and column highlighted | |
// instead of just the row th and column th | |
background-color: #FFFFFF; | |
} | |
table td:after { | |
content: ''; | |
height: 10000px; | |
left: 0; | |
position: absolute; | |
top: -5000px; | |
-webkit-transition: background-color 0.3s; | |
transition: background-color 0.3s; | |
width: 100%; | |
z-index: -1; | |
} | |
table tr:hover, | |
table td:hover:after, | |
table td:hover { | |
background-color: rgba(0,0,0,0.125); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment