JSFiddle - React, Tailwind, and code Playground
by Lijo
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
</title>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.1.js"></script>
<script type="text/javascript">
$(document).ready(function ()
{
alert($("#myTable"));
$("#myTable th, #myTable td").each(function (i)
{
//$(this).css('background-color', ['red', 'yellow', 'blue'][i % 3]);
if (i % 3 == 0)
{
$(this).css('background-color', 'red');
}
if (i % 3 == 1)
{
$(this).css('background-color', 'yellow');
}
if (i % 3 == 2)
{
$(this).css('background-color', 'green');
}
});
});
</script>
</head>
<body>
<table id = "myTable">
<thead>
<tr>
<th>
Name
</th>
<th>
Address
</th>
<th>
Age
</th>
</tr>
</thead>
<tr>
<td>
Lijo
</td>
<td>
India
</td>
<td>
27
</td>
</tr>
</table>
</body>
</html>