you can creatively use the {$rank} template tag and use that to build your CSS classes.
example:
<div class="table_top nice{$rank}">
then in CSS you can set your backgrounds etc.
.nice1 {
background: red;
}
.nice2 {
background: yellow;
}
.nice3 {
background: green;
}