My JavaScript code dynamically creates rows in an HTML table using a for loop.
Below is the for loop that generates rows for my HTML table:
for(var j=0;j<5;j++) {
var row = createNewRow(obj);
jQuery("#test").append(row);
}
function createNewRow (obj)
{
// html for creating five rows per page
var str="";
str+=<tr>;
str +=<td>;
str +=<td>;
......
str +=<tr>;
return str;
}
I have successfully created five rows per page, but I'm now looking for help with applying CSS to alternate rows in the table.