Export Html Table to excel and keep css styles

newbie_86 picture newbie_86 · Aug 2, 2011 · Viewed 25.9k times · Source

I'm using excel web queries to export an html table (mvc view) to excel. How do I get it to carry across the css styles? If I set class="redLabel" it doesn't interpret that and make the label red. I have to use inline styles in my table for this to work. Any ideas?

Answer

Madara's Ghost picture Madara's Ghost · Aug 4, 2011

As far as I know, most Office programs do NOT support included styling, but only inline styling.

It's likely that you'll be required to include your styling inline (exporting sucks, almost like mail styling).