I need CSS help

Ren
Wed, 22 Jul 2020 19:17:01 +0000

Faraday has good questions, but just working with what’s there your most immediate issue is probably that you’re giving background colours to both TDs and TRs – you’re not going to see any of the TR colour unless you create some weird spacing. If you want striping, you may want to stick to the TR colours for the non-head cells.

I’ve tried to boil down the CSS you pasted somewhat, but I’m taking the liberty of guessing you don’t want the tables that aren’t .table-striped to be striped. If you do, then you don’t want the tr:nth-of-type(odd) to only apply to .table-striped.

tr {
   background-color: #404040
}

th {
   background-color: #2b2b2b;
   color: #d8d8d8;
   font-size: 16px;
}

thead th {
   border-bottom: 2px solid #1f1f1f;
}

tbody th {
   border-top: 1px solid #1f1f1f;
   border-left: 1px solid #1f1f1f;
}

td {
   border-top: 1px solid #292929;
}

/* Striped Tables */

.table-striped tr:nth-of-type(odd) {
   background-color: #353535;
}

Remember that because CSS cascades, order and specificity often matter.