The CSS code from the Stylesheet tab is applied to the whole table or specific rows/columns that are defined by indexes.
If you need to apply precise formatting based on cells' contents, you should visit the "Advanced table cells formatting" page and use the FORMATWIKI/FORMATMARKDOWN functions within your custom SQL queries.