I have a div populated with a list of rows, and I want to alternate the row colors. To achieve this, I am using the following code:
$('#PlatformErrorsTableData').html(table1Html);
$('#PlatformErrorsTableData div:nth-child(even)').css("background-color", "aqua");
The structure of table1Html is as follows:
<div>
<span class="platformTable columnWidth10">Originator1</span>
<span class="platformTable truncate">Message for Originator# 1</span>
<span class="platformTable columnWidth15">Server1</span>
<span class="platformTable columnWidth20">5:50 PM</span>
</div>
<div>
<span class="platformTable columnWidth10">Originator2</span>
<span class="platformTable truncate">Message for Originator# 2</span>
<span class="platformTable columnWidth15">Server2</span>
<span class="platformTable columnWidth20">5:50 PM</span>
</div>
<div>
<span class="platformTable columnWidth10">Originator3</span>
<span class="platformTable truncate">Message for Originator# 3</span>
<span class="platformTable columnWidth15">Server3</span>
<span class="platformTable columnWidth20">5:50 PM</span>
</div>
<div>
<span class="platformTable columnWidth10">Originator4</span>
<span class="platformTable truncate">Message for Originator# 4</span>
<span class="platformTable columnWidth15">Server4</span>
<span class="platformTable columnWidth20">5:50 PM</span>
</div>
However, despite setting the background color to aqua, it is not displaying on screen. Upon inspecting the div with Firebug, the background color property is correctly set to aqua.
Any assistance in resolving this issue would be greatly appreciated.