It's enough to use isset() as it gives the same result that you want to achieve.
An improvement of the coding style would be if you create the string of CSS classes before outputting the table row and echo only the result in the class attribute.