JSF isn't ultimately an HTML framework. It's an abstract framework supported by a set of renderers, the most popular of which renders output as HTML.
So it's NOT a good idea to insert HTML into the JSF view definition. It breaks portability. And, as you have seen, it can be discarded as garbage.
In most cases, the JSF tags have direct semantic view support, so it's usually sufficient to use the appropriate JSF tag attributes such as rowClasses, columnClasses, and where nothing more precise is available, the style and styleClass attributes.
If it's absolutely positively necessary to inject raw HTML into the view definition, use the <f:verbatim> tag to wrap it.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.