Formatting table having problems - can anyone help
Posted: Mon Dec 20, 2004 5:36 am
Guys, I want to incorporate some formatting to my table to give each of the coloums a heading and format the table but when I add my coding ithe screen goes blank.
how would I go about incorporating the formatting below into my code which is below this.
how would I go about incorporating the formatting below into my code which is below this.
Code: Select all
echo "<table width="50%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td width="110"><b><small>ID</small></b></td>
<td><b></b></td>
<td><b><small>First Name</small></b></td>
<td><b><small>Surname</small></b></td>
<td><b><small>Organisation</small></b></td>
<td><b><center><small>Role</small></center></b></td>
<td><b><small>Address(1)</small></b></td>
<td><b><small>Address(2)</small></b></td>
<td><b><small>City</small></b></td>
<td><b><small>Post Code</small></b></td>
<td><b><small>Telephone</small></b></td>
<td><b><small>Mobile</small></b></td>
<td><b><small>Fax</small></b></td>
<td><b><small>Last Contact</small></b></td>
<td><b><small>Contact Again</small></b></td>
<td><b><small>Notes</small></b></td>
</tr>";Code: Select all
"<table>";while ($row = mysql_fetch_object($sql))
{($color==$color2)? $color = $color1 : $color = $color2;
echo "<tr bgcolor="$color"><td>".$count . '</td><td> ' . $row->person_id .'</td><td>'.
$row->salutation .'</td><td>'.
$row->firstname .'</td><td>'.
$row->surname .'</td><td>'.
$row->organisation .'</td><td>'.
$row->role.'</td><td>'.
$row->address1 .'</td><td>'.
$row->address2 .'</td><td>'.
$row->city .'</td><td>'.
$row->postcode .'</td><td>'.
$row->telephone .'</td><td>'.
$row->mobile .'</td><td>'.
$row->fax .'</td><td>'.
$row->dateoflastcontact.'</td><td>'.
$row->datecontactagain .'</td><td>'.
$row->email .'</td><td>'.
$row->notes .'</td></tr>';
$count += 1;
}
echo "</table>";