これは非常に単純に聞こえますが、それに関する多くの投稿を見つけることができません。
基本的には、最初の列の赤、2番目の緑、3番目の赤などが必要です...
cssでこれを行うにはどうすればよいですか?
これが私のhtmlコードです(私はブートストラップ3を使用しています):
<table class="table table-striped">
<thead>
<tr>
<th>Welsh</th>
<th>English</th>
</tr>
</thead>
<tbody>
<tr>
<td>Shwmae <a href="#" onclick="playAudio('shwmae');"><span class="glyphicon glyphicon-volume-up play"></span></a></td>
<td>Hello</td>
</tr>
<tr>
<td>Bore da <a href="#" onclick="playAudio('boreda');"><span class="glyphicon glyphicon-volume-up play"></span></a></td>
<td>Good morning</td>
</tr>
<tr>
</tbody>
</table>
次のCSSを使用してみましたが、何もしませんでした:
col:first-child {background: #FF0}
col:nth-child(2n+3) {background: #CCC}