Quick Nicer Table CSS

2020-01-25

:root {
  --theme-color-primary: #3ab97e;
}
table{
  border-collapse:collapse;
  font-size:.8em;
  margin:16px 0;
}
table td,table th{
  border:1px solid #ddd;
  padding:4px;
}
table tr:nth-child(even){
  background-color: #f2f2f2;
}
table tr:hover{
  background-color: #ddd;
}
table th{
  text-align: left;
  background-color: var(--theme-color-primary);
  color: white;
}

Example Table:

idname
1banana
2hamburger
3pamplemousse