JSFiddle - React, Tailwind, and code Playground

by dodozhang21

HTML

<table border="0" cellpadding="0" cellspacing="0" class="alternatingRows">
<tr>
<td>Row 1</td>
</tr>
<tr>
<td>Row 2</td>
</tr>
<tr>
<td>Row 3</td>
</tr>
<tr>
<td>Row 4</td>
</tr>
</table>

CSS

.alternatingRows {
    width: 100%;
}
.alternatingRows tr:nth-child(odd) td { 
    background-color:#eee; 
}
.alternatingRows tr:nth-child(even) td { 
    background-color:red; 
}