Hi
I retrieve data from my database. There are 12 columns with the last column proving the county value. This can obviously vary dependant on the stored value(Devon or Greater Manchester etc). My problem is that dependant on the size the whole row changes length when the county value changes especialy if there is only one row retireved. This then alters the line up with my headings , the values within the rows running out of line. I have been trying varying methods to sort this but as a newbie I am struggling any help would be much appreciated. Here is my code
<table cellSpacing="0" cellPadding="1" border="0" class="itemTable" width="1002" height="30" >
<tr height="50" bgcolor="#D6DEFF" >
<td width="1" height="28"><img src="images/newline.gif" width="1" height="50">
<td align="center" width="53" height="28"><font face="Veranda" size="1" color="#000000">Good Terms</font></td><td width="1" height="28"><img src="images/newline.gif" width="1" height="50">
<td align="center" width="63" height="28"><font face="Veranda" size="1" color="#000000"> Rent </font></td><td width="1" height="28"><img src="images/newline.gif" width="1" height="50">
<td align="center" width="51" height="28"><font face="Veranda" size="1" color="#000000"> Looked
after </font> </td><td width="1" height="28"><img src="images/newline.gif" width="1" height="50">
<td align="center" width="56" height="28"><font face="Veranda" size="1" color="#000000"> Damaged</font></td><td width="1" height="28"><img src="images/newline.gif" width="1" height="50">
<td align="center" width="59" height="28"><font face="Veranda" size="1" color="#000000">Complaints </td><td width="1" height="28"><img src="images/newline.gif" width="1" height="50">
<td align="center" width="57" height="28"><font face="Veranda" size="1" color="#000000">Rent</td><td width="1" height="28"><img src="images/newline.gif" width="1" height="50">
<td align="center" width="57" height="28"><font face="Veranda" size="1" color="#000000">Evicted </td><td width="1" height="28"><img src="images/newline.gif" width="1" height="50">
<td align="center" width="55" height="28"><font face="Veranda" size="1" color="#000000">Rent Again</td><td width="1" height="28"><img src="images/newline.gif" width="1" height="50">
<td align="center" width="120" height="28"><font face="Veranda" size="1" color="#000000">Date Record Submitted</td><td width="1" height="28"><img src="images/newline.gif" width="1" height="50">
<td align="center" width="67" height="28"><font face="Veranda" size="1" color="#000000">ID</td><td width="4" height="28"><img src="images/newline.gif" width="1" height="50">
<td align="center" width="85" height="28"><font face="Veranda" size="1" color="#000000">Overall
Percentage</font><td width="4" height="28"><img src="images/newline.gif" width="1" height="50">
<td align="center" width="200" height="28"><font face="Veranda" size="1" color="#000000">County</font></td>
</td>
</tr>
</table>
<center>
<table border="0" width="100%" height="50" bordercolor="#111111">
<tr>
<td width="100%" height="50" valign="top" bordercolor="#111111">
<div class="scrollable" style="height:100px; width:100%; overflow:auto;">
<table cellSpacing="0" cellPadding="1" border="0" id="RecentFeedback" class="itemTable" width="100%" height="50">
<td align="center"><font face="Veranda" size="2" color="#000000"></td>
<td align="center"><font face="Veranda" size="2" color="#000000"></td>
<td align="center"><font face="Veranda" size="2" color="#000000"></td>
<td align="center"><font face="Veranda" size="2" color="#000000"> </td>
<td align="center"><font face="Veranda" size="2" color="#000000"></td>
<td align="center"><font face="Veranda" size="2" color="#000000"></td>
<td align="center"><font face="Veranda" size="2" color="#000000"></td>
<td align="center"><font face="Veranda" size="2" color="#000000"></td>
<td align="center"><font face="Veranda" size="2" color="#000000"></td>
<td align="center"><font face="Veranda" size="2" color="#000000"></td>
<td align="center"><font face="Veranda" size="2" color="#000000"></td>
<td align="center"><font face="Veranda" size="2" color="#000000"></td>
</tr>
<?
$bg_color1 = '#EEEEEE';
$bg_color2 = '#FFFFFFF';
$i = 0;
while ($row = mysql_fetch_array($result)) {
$bg_color = (($i%2 == 0 || $i == 0) ? $bg_color1 : $bg_color2);
$last = $row["surname"];
$first = $row["firstname"];
$date = $row["date"];
$dob = $row["dob"];
$id = $row["id"];
$left = $row["left"];
$rent = $row["rent"];
$look = $row["look"];
$dam = $row["dam"];
$comp = $row["comp"];
$diff = $row["diff"];
$evic = $row["evic"];
$would = $row["would"];
$date = $row["date"];
$id = $row["id"];
$county = $row["county"];
?>
<form action="result.php" method="get"><font face="Veranda" size="2" color="#000000" align="center">
<? echo "<td bgcolor=$bg_color>$left";
if ($left == "Yes"){
echo "<font color = #00FF00 >$pos1</font>";
$pos1 = '12.5';
}
else {
echo "<font color = #FF0000>$neg1</font>";
$pos1 = '0';
}
?></td>
<? echo "<td bgcolor=$bg_color>$rent";
if($rent == "No"){
echo "<font color = #00FF00 >$pos2</font>";
$pos2 = '12.5';
}
else {
echo "<font color = #FF0000>$neg2</font>";
$pos2 = '0';
}
?></td>
<? echo "<td bgcolor=$bg_color>$look";
if ($look == "Yes"){
echo "<font color = #00FF00 >$pos3</font>";
$pos3 = '12.5';
}
else {
echo "<font color = #FF0000>$neg3</font>";
$pos3 = '0';
}
?></td>
<? echo "<td bgcolor=$bg_color>$dam";
if($dam == "No"){
echo "<font color = #00FF00 >$pos4</font>";
$pos4 ='12.5';
}
else {
echo "<font color = #FF0000>$neg4</font>";
$pos4 = '0';
}
?></td>
<? echo "<td bgcolor=$bg_color>$comp";
if($comp == "No"){
echo "<font color = #00FF00 >$pos5</font>";
$pos5 = '12.5';
}
else {
echo "<font color = #FF0000>$neg5</font>";
$pos5 = '0';
}
?> </td>
<? echo "<td bgcolor=$bg_color>$diff";
if($diff == "No"){
echo "<font color = #00FF00 >$pos6</font>";
$pos6 = '12.5';
}
else {
echo "<font color = #FF0000>$neg6</font>";
$pos6 ='0';
}
?></td>
<? echo "<td bgcolor=$bg_color>$evic";
if($evic == "No"){
echo "<font color = #00FF00 >$pos7</font>";
$pos7 = '12.5';
}
else {
echo "<font color = #FF0000>$neg7</font>";
$pos7 = '0';
}
?> </td>
<? echo "<td bgcolor=$bg_color>$would";
if($would == "Yes"){
echo "<font color = #00FF00 >$pos8</font>";
$pos8 = '12.5';
}
else {
echo "<font color = #FF0000>$neg8</font>";
$pos8 = '0';
}
if ($total !=1) {
$percentage =$pos8+$pos7+$pos6+$pos5+$pos4+$pos3+$pos2+$pos1;
}
else {
}
$pos1 ="+";
$neg1 =" -";
$pos2 =" +";
$neg2 ="-";
$pos3 ="+";
$neg3 =" -";
$pos4 =" +";
$neg4 ="-";
$pos5 =" +";
$neg5 ="-";
$pos6 =" +";
$neg6 ="-";
$pos7 =" +";
$neg7 ="-";
$pos8 ="+";
$neg8 =" -";
?>
</td>
<? echo "<td bgcolor=$bg_color>$date"; ?></td>
<? echo "<td bgcolor=$bg_color>$id"; ?></td>
<? echo "<td bgcolor=$bg_color>";
if ($percentage >= 87.5) {
$color = '#00FF00';
} elseif ($percentage >= 37.5) {
$color = '#ff9900';
} else {
$color = 'red';
}
echo '<b style="color:' . $color . '">' . $percentage . '</b>';
?> </td>
<? echo "<td bgcolor=$bg_color align='center'>$county</td>"; ?>
</form>
</tr>
<?
$i++;
}
echo "</table>";
?>
</div>
Thanks, roscor