I've been struggling to create a CSS table style using tr:nth-child to alternate row colors:
Row 1 - Blue
Row 2 - Blue
Row 3 - White
Row 4 - White
... and so on.
I can't seem to get it right! Can anyone help me out with this?
Appreciate any assistance...
The HTML is generated by Powershell convertto-html, producing something like this:
<head>
<title>HTML TABLE</title>
<link rel="stylesheet" type="text/css" href=".\table.css" />
</head><body>
<p style="text-align:center;"><H2>Header</H2>
<table>
<tr><th>Count</th><th>Name</th></tr>
<tr><td>1</td><td>Gary</td></tr>
<tr><td>2</td><td>Sarah</td></tr>
<tr><td>3</td><td>Bob</td></tr>
<tr><td>4</td><td>Ian</td></tr>
<tr><td>5</td><td>Susan</td></tr>
<tr><td>6</td><td>Robin</td></tr>
<tr><td>7</td><td>Paul</td></tr>
<tr><td>8</td><td>Jane</td></tr>
</table>
</body></html>