AndyTitan,
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<table class="table">
<caption>Test task</caption>
<tbody>
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
<td>5</td>
</tr>
<tr>
<td>6</td>
<td>7</td>
</tr>
</tbody>
</table>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script>
$('.table').on({
'mouseenter': function () {
var num = $(this).text();
$(this).css({
backgroundColor: (num % 2 == 0) ? 'yellow' : 'brown',
});
},
'mouseleave': function () {
$(this).css({
backgroundColor: '',
});
}
}, 'td');
</script>
</body>
</html>