Created
February 26, 2018 22:17
-
-
Save pataiadam/8e87c6c393cae638c4a6eb81d75d910f to your computer and use it in GitHub Desktop.
simple table css
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 { | |
color: #333; | |
font-family: Helvetica, Arial, sans-serif; | |
width: 640px; | |
border-collapse: | |
collapse; border-spacing: 0; | |
} | |
td, th { | |
border: 1px solid transparent; /* No more visible border */ | |
height: 30px; | |
transition: all 0.3s; /* Simple transition for hover effect */ | |
} | |
th { | |
background: #DFDFDF; /* Darken header a bit */ | |
font-weight: bold; | |
} | |
td { | |
background: #FAFAFA; | |
text-align: center; | |
} | |
/* Cells in even rows (2,4,6...) are one color */ | |
tr:nth-child(even) td { background: #F1F1F1; } | |
/* Cells in odd rows (1,3,5...) are another (excludes header cells) */ | |
tr:nth-child(odd) td { background: #FEFEFE; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment