This really depends on how you want to do this. I think I would handle it with CSS.
Just add in your products_t.tpl somewhere a class definition associated with categoryid.
I'm assuming the categoryid is assigned to Smarty, and it is something like this {$cat} = 123
So in the container div you could do something like this:
Code:
<div class="products{if $cat != ''}cat-{$cat}{/if}">
Then you can add CSS specific to that category.