Skip to content

Instantly share code, notes, and snippets.

@pataiadam
Created February 26, 2018 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pataiadam/8e87c6c393cae638c4a6eb81d75d910f to your computer and use it in GitHub Desktop.
Save pataiadam/8e87c6c393cae638c4a6eb81d75d910f to your computer and use it in GitHub Desktop.
simple table css
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