Is that possible to have two styles for one element with different colors?

In other words, lets suppose I have following HTML code:

```
<table class='my_table'>
<th class="style1 style2">LastName</th>
...
</table>

```

and following CSS:

```
.my_table th.style1 { 
    background: #aaaaaa; 
}

.my_table th.style2 { 
    background: #bbbbbb; 
} 

```

I understand that I can remove one style with JavaScript for some condition. But I would like to have two styles and one of them should override another. Is that possible?