I have a page that displays a table for teams league positions, I am trying to get the top row one colour, the second row another colour, and the bottom two another colour. This is to highlight winners, promotion, and relegation. I've attached the code, you can see it's already set to add a line after the first 2 and before the last 2. Please can anyone help? I've researched but I'm struggling :( I use CSS.
{
//Lets print data
$j=1;
$i=0;
while($i< $qty)
{
if(isset($draw_line))
{
//Tarkistetaan, piirretäänkö erotusviiva
for($k = 0 ; $k < sizeof($draw_line) ; $k++)
{
if($draw_line[$k] == $i)
{
$templine_width = $tb_width-20;
echo"<tr>
<td height=\"2\" colspan=\"20\" align=\"center\" valign=\"middle\">
<img src=\"images/line.png\" width=\"$templine_width\" height=\"1\" ALT=\"\"><br>
</td>
</tr>";
}
}
}
echo"<tr><td align=\"center\" height=\"25\" cellspacing=\"1\" valign=\"middle\" bgcolor=\"$bg1\">$j</td>
<td align=\"left\" valign=\"middle\" cellspacing=\"1\" bgcolor=\"$bg1\"> $team[$i]</td>
<td align=\"center\" valign=\"middle\" bgcolor=\"$bg1\">";
if($sort == 'pld')
echo'<b>';
echo"$pld[$i]";
if($sort == 'pld')
echo'</b>';
echo"</td>
<td align=\"center\" valign=\"middle\" bgcolor=\"$bg1\">";
if($sort == 'tw')
echo'<b>';
echo"$wins[$i]";
if($sort == 'tw')
echo'</b>';
echo"</td>
<td align=\"center\" valign=\"middle\" bgcolor=\"$bg1\">";
if($sort == 'td')
echo'<b>';
echo"$draws[$i]";
if($sort == 'td')
echo'</b>';
echo"</td>
<td align=\"center\" valign=\"middle\" bgcolor=\"$bg1\">";
if($sort == 'tl')
echo'<b>';
echo"$loses[$i]";
if($sort == 'tl')
echo'</b>';
echo"</td>
<td align=\"center\" valign=\"middle\" bgcolor=\"$bg1\">";
if($sort == 'tf')
echo'<b>';
echo"$goals_for[$i]";
if($sort == 'tf')
echo'</b>';
echo"</td>
<td align=\"center\" valign=\"middle\" bgcolor=\"$bg1\">";
if($sort == 'ta')
echo'<b>';
echo"$goals_against[$i]";
if($sort == 'ta')
echo'</b>';
echo"</td>
<td align=\"center\" valign=\"middle\" bgcolor=\"$bg1\">";
if($sort == 'GD')
echo'<b>';
$GD = $goals_for[$i] - $goals_against[$i];
echo"$GD";
if($sort == 'GD')
echo'</b>';
echo"</td>
<td align=\"center\" valign=\"middle\" bgcolor=\"$bg1\">";
if($sort == 'pts')
echo'<b>';
echo"$points[$i]";
if($sort == 'pts')
echo'</b>';
echo"</td>
</tr>";
$i++;
$j++;
}
}
}