Alternating row colors

The Table below I want the first row yellow then the next no color the 3rd row gray then the 4th white then keep alternating the gray and white or gray and no color?

<table height="209" >
        <tr align="left" valign="middle"> 
          <td colspan="4">Bear Watching Lodge Rates</td>
        </tr>
        <tr align="left" valign="middle"> 
          <td colspan="4">Rates are per person. Bear Viewing Season June 2010 
            thru September 2010</td>
        </tr>
        <tr> 
          <td width="60" align="left" valign="middle">Price</td>
          <td width="142" align="center" valign="middle">$5,400</td>
          <td width="137" align="center" valign="middle">$3,700</td>
          <td width="111" align="center" valign="middle">$2,950</td>
        </tr>
        <tr> 
          <td rowspan="2" align="left" valign="middle">Days</td>
          <td align="center" valign="middle">8 days - 7 nights</td>
          <td align="center" valign="middle">5 days - 4 nights</td>
          <td align="center" valign="middle">4 days - 3 nights</td>
        </tr>
        <tr> 
          <td align="center" valign="middle">Sunday - Sunday</td>
          <td align="center" valign="middle">Sunday - Thursday</td>
          <td align="center" valign="middle">Thursday - Sunday</td>
        </tr>
        <tr align="left" valign="middle"> 
          <td colspan="4">Bear watching lodge trips include 3 meals daily, private 
            river front lodging, guided bear viewing/photography unlimited activities 
            including fishing, daily raft trips, jet boat tours and nature hikes</td>
        </tr>
        <tr align="left" valign="middle">
          <td colspan="4">Wilderness bear watching lodge trips require an additional 
            floatplane charter flight <br />
            from King Salmon of $300 Per Person</td>
        </tr>
      </table>

Open in new window

LVL 1
smphilAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Cornelia YoderArtistCommented:
There is no magic way to do this.  Easiest is to make a php loop and put the three color lines in it and then just keep repeating via the loop.
0
smphilAuthor Commented:
OK how can I do it line by line whithin the table?
0
remorinaCommented:
no color = white
You can assign an inline style background to the <tr> element, not so elegant but would do the job

<table height="209" >
        <tr align="left" valign="middle" style="background-color:yellow"> 
          <td colspan="4">Bear Watching Lodge Rates</td>
        </tr>
        <tr align="left" valign="middle"> 
          <td colspan="4">Rates are per person. Bear Viewing Season June 2010 
            thru September 2010</td>
        </tr>
        <tr style="background-color:gray"> 
          <td width="60" align="left" valign="middle">Price</td>
          <td width="142" align="center" valign="middle">$5,400</td>
          <td width="137" align="center" valign="middle">$3,700</td>
          <td width="111" align="center" valign="middle">$2,950</td>
        </tr>
        <tr> 
          <td rowspan="2" align="left" valign="middle">Days</td>
          <td align="center" valign="middle">8 days - 7 nights</td>
          <td align="center" valign="middle">5 days - 4 nights</td>
          <td align="center" valign="middle">4 days - 3 nights</td>
        </tr>
        <tr > 
          <td align="center" valign="middle">Sunday - Sunday</td>
          <td align="center" valign="middle">Sunday - Thursday</td>
          <td align="center" valign="middle">Thursday - Sunday</td>
        </tr>
        <tr align="left" valign="middle"  style="background-color:gray"> 
          <td colspan="4">Bear watching lodge trips include 3 meals daily, private 
            river front lodging, guided bear viewing/photography unlimited activities 
            including fishing, daily raft trips, jet boat tours and nature hikes</td>
        </tr>
        <tr align="left" valign="middle">
          <td colspan="4">Wilderness bear watching lodge trips require an additional 
            floatplane charter flight <br />
            from King Salmon of $300 Per Person</td>
        </tr>
      </table>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
smphilAuthor Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.