Conditional formatting in a table

Hello,

I’m trying to apply conditional formatting to a table.

E.g. if cost actual <= cost budget then mark cell in green
if cost actual > cost budget then mark cell in red

I’ve tried various things but can’t get it right, can someone help?

thanks

Department Costs <#assign cls = "inactive"><#if costactual[0].Amount??><#assign cls = "active"> ${costbudget[0].Amount?number} ${(costactual[0].Amount?number)!0} <#assign cls = "inactive"><#if costactual[1].Amount??><#assign cls = "active"> ${costbudget[1].Amount?number} ${(costactual[1].Amount?number)!0} <#assign cls = "inactive"><#if costactual[2].Amount??><#assign cls = "active"> ${costbudget[2].Amount?number} ${(costactual[2].Amount?number)!0} <#assign cls = "inactive"><#if var_costactual_Q1 != 0><#assign cls = "active"> ${var_costbudget_Q1} ${var_costactual_Q1}