Change bg colour on rows based on cell value
I have a column containing "Section1", "Section2" and "Section3".
I want to find the right column (first one), and the cell that contains "Section1" and for that row I want to set a blue background. Also I want to do this for all the rows beneath until "Section2" is found. Then the row for "Section2" will have another colour, as well as the rows beneath until "Section3" is found and so on...
This is the result I would prefer:

How could I achieve that?
<table class="fooBar" width="200" border="0">
- <tr style="background-color:#ccc">
- <td><b>ColHeader1</b></td>
- <td><b>ColHeader2</b></td>
- <td><b>ColHeader3</b></td>
- </tr>
- <tr class="section1">
- <td><b>Section1</b></td>
- <td> </td>
- <td> </td>
- </tr>
- <tr class="section1">
- <td>CellData</td>
- <td>CellData</td>
- <td>CellData</td>
- </tr>
- <tr class="section1">
- <td>CellData</td>
- <td>CellData</td>
- <td>CellData</td>
- </tr>
- <tr class="section2">
- <td><b>Section2</b></td>
- <td> </td>
- <td> </td>
- </tr>
- <tr class="section2">
- <td>CellData</td>
- <td>CellData</td>
- <td>CellData</td>
- </tr>
- <tr class="section2">
- <td>CellData</td>
- <td>CellData</td>
- <td>CellData</td>
- </tr>
- <tr class="section3">
- <td><b>Section3</b></td>
- <td> </td>
- <td> </td>
- </tr>
- <tr class="section3">
- <td>CellData</td>
- <td>CellData</td>
- <td>CellData</td>
- </tr>
- <tr class="section3">
- <td>CellData</td>
- <td>CellData</td>
- <td>CellData</td>
- </tr>
- </table>