var rowCount = 0;
var trCount;
// Set start each at second tr
$('#list tr').each(function(index, tr) {
// Count
rowCount++;
// Create tr
trCount = $('<tr/>');
// Create row number 1,2,3
trCount.append("<td>" + rowCount + "</td>");
// Append tr to display table
tableContent.append(trCount);
});
i am using the to create tr to my table , but my intention here is there will be different background-color between odd and even tr number , so how do i do this ?
something like this
$("tr:odd").css("background-color", "#E5E5E5");
$("tr:even:gt(0)").css("background-color", "#c7d4e5");
how do i append different back ground color when creating <tr>
.