Color a table row with style="color:#fff" for displaying in an email

css, html, html-email, html-table

Solution

you can easily do like this:-

    <table>
    <thead>
        <tr>
          <th bgcolor="#5D7B9D"><font color="#fff">Header 1</font></th>
          <th bgcolor="#5D7B9D"><font color="#fff">Header 2</font></th>
           <th bgcolor="#5D7B9D"><font color="#fff">Header 3</font></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>blah blah</td>
            <td>blah blah</td>
            <td>blah blah</td>
        </tr>
    </tbody>
</table>

Demo:- http://jsfiddle.net/VWdxj/7/

Problem

We would like to display order details as table in an email ``` ​<table> <thead> <tr> <th>Header 1</th> <th>Header 2</th> <th>Header 3</th> </tr> </thead> <tbody> <tr> <td>blah blah</td> <td>blah blah</td> <td>blah blah</td> </tr> </tbody> </table>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ ``` We would ideally want the header to have background-color as '#5D7B9D' and text-color as '#fff'. We are using `bgcolor='#5D7B9D'` for changing the background-color and are unable to find an alternative to do the same for changing the text-color. As most of the email providers strip the CSS, we cannot use `style` attribute at all. The questions are - How to make the header text appear in white? - Are there any alternate methods?

Original source