JSFiddle - React, Tailwind, and code Playground
HTML
<table class="table1">
<tr>
<th>Name</th>
<th>Surname</th>
<th>Email</th>
</tr>
<tr>
<td>@p.Name</td>
<td>@p.Surname</td>
<td>@p.Number</td>
</tr>
<tr>
<td>@p.Name</td>
<td>@p.Surname</td>
<td>@p.Number</td>
</tr>
<tr>
<td>@p.Name</td>
<td>@p.Surname</td>
<td>@p.Number</td>
</tr>
</table>
JavaScript
$(function() {
var rows = $('.table1').find('tr').each(
function() {
$(this).css('background', get_random_color());
});
});
function get_random_color() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.round(Math.random() * 15)];
}
return color;
}