Looking to implement jQuery tablesorter for sorting and styling odd rows in a table.
Encountered an issue with IE8 where the row background or style is not applied to odd rows. Any suggestions on how to fix this for IE versions below 9?
Check out the live demo here - Everything seems to work fine on all browsers except IE 10 and lower.
Appreciate any help!
JSP:
<html>
<head>
<style type="text/css">
.tablesorter tbody tr:nth-child(odd) {
background-color: #faf4e2;
}
</style>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.21.5/js/jquery.tablesorter.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#myTable").tablesorter();
}
);
</script>
</head>
<body>
<table id="myTable" class="tablesorter">
<thead>
<tr>
<th>Last Name</th>
<th>First Name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<tr>
<td>Saul</td>
<td>Tarsus</td>
<td><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="067572466b676f6a2865696b">[email protected]</a></td>
</tr>
<tr>
<td>Paul</td>
<td>Rock</td>
<td><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4c3c3e0c212d2520622f2321">[email protected]</a></td>
</tr>
</tbody>
</table>
</body>
</html>