tags:

views:

32

answers:

2

table row background color supports in IE but not in safari

+2  A: 

HTML:

 <table id="mytable">
   <thead> <!-- Optional -->
      <tr>
         <th></th>
      </tr>
   </thead>
   <tbody>
      <tr>
         <td></td>
      </tr>
   </tbody>
   <tfoot> <!-- Optional -->
      <tr>
         <td></td>
      </tr>
   </tfoot>
 </table> 

CSS:

 table#mytable { background-color: #004455; }

You can also use inline styles, but I'm not going to recommend them because it sounds like you need to learn how to do things the right way before you're allowed to make a call on doing them the wrong way.

Graphain
That would color the table, not the table rows
Gordon
I couldn't understand what he wanted so thanks.
Graphain
A: 
<table>
  <tr class="color_red">
    <td></td>
  </tr>
  <tr class="color_green">
    <td></td>
  </tr>
</table

<style>
tr.color_red
{
    background-color:red;
}

tr.color_green
{
    background-color:green;
}
</style>
rockinthesixstring
Thanks. Actually i got the answer.
khemraj