Display record in table format

<!-- Save as displayrecord.php -->
<?php
include("config.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Display Records</title>
<style type="text/css">
body{
background-color:#000;
color:#000000;
}
table{
border: solid 1 px #333333;
background-color:#f5f5f5;
margin:0 auto;
margin-top:120px;
text-align:left;
font-size:15px;
border-color:#333333;
width:100%;
height:auto;
}
th{
text-align:center;
color:#0000ff;
}
.c1{
background-color:#e5e5e5;
}
.c2{
background-color:#d5d5d5;
}
table tr:hover
{
  background-color: #ccffcc;
}
table tr:visited
{
  background-color: #ffcc99;
}
</style>
<script language="javascript">
function checkAll(){
for (var i=0;i<document.forms[0].elements.length;i++)
{
var e=document.forms[0].elements[i];
if ((e.name != 'allbox') && (e.type=='checkbox'))
{
e.checked=document.forms[0].allbox.checked;
}
}
}
</script>
</head>

<body>
<form>
<table border='0' cellpadding="2" cellspacing="2" align="center">
<tr style="background-color:#d3dce3;">
<th colspan="3"></td>
<th>First Name</th>
<th>Middle Name</th>
<th>Last Name</th>
<th>User Name</th>
<th>Gender</th>
<th>Prefered Location</th>
<th>Address</th>
<th>STD Code</th>
<th>Phone No</th>
<th>Country Code</th>
<th>Mobile Number</th>
<th>City</th>
<th>State</th>
<th>Country</th>
</tr>
<?php
$counter=1;
$c;
$output=mysql_query("SELECT * FROM registered_user");
while($data = mysql_fetch_array($output))
{
   $editID= $data['userid'];
$delID= $data['userid'];

$firstname=stripslashes($data['firstname']);
$middlename=stripslashes($data['middlename']);
$lastname=stripslashes($data['lastname']);
$username=stripslashes($data['username']);
$sex=$data['sex'];
$preflocation=$data['preflocation'];
$address=stripslashes($data['address']);
$stdcode=stripslashes($data['stdcode']);
$phoneno=stripslashes($data['phoneno']);
$countrycode=stripslashes($data['countrycode']);
$mobileno=stripslashes($data['mobileno']);

$city_id=$data['city_id'];
$getCityName=mysql_query("SELECT city_name FROM tbl_city WHERE city_id=$city_id");
while($cityName=mysql_fetch_array($getCityName))
{
$city=$cityName['city_name'];
}

$state_id=$data['state_id'];
$getStateName=mysql_query("SELECT state_name FROM tbl_state WHERE state_id=$state_id");
while($stateName=mysql_fetch_array($getStateName))
{
$state=$stateName['state_name'];
}

$country=stripslashes($data['country']);

if($counter%2==0)
{
$c=c1;
}
else
{
$c=c2;
}
?>
   <tr class="<?php echo $c; ?>">
<td><input type="checkbox" name="chk1" value="on" /></td>
<td><a href="edit_registration.php?edit=<?php echo $editID; ?>"><img src="images/b_edit.png" alt="Edit" title="Edit" style="border:none;"></a></td>
<td><a onclick='if(confirm("Are you sure you want to delete ?")){ return true;}else{return false;}' href="deluser.php?del=<?php echo $delID; ?>" alt="Delete" title="Delete" ><img src="images/b_drop.png" style="border:none;"></a></td>
<td><?php echo $firstname ?></td>
<td><?php echo $middlename ?></td>
<td><?php echo $lastname ?></td>
<td><?php echo $username ?></td>
<td><?php echo $sex ?></td>
<td><?php echo $preflocation ?></td>
<td><?php echo $address ?></td>
<td><?php echo $stdcode ?></td>
<td><?php echo $phoneno ?></td>
<td><?php echo $countrycode ?></td>
<td><?php echo $mobileno ?></td>
<td><?php echo $city ?></td>
<td><?php echo $state ?></td>
<td><?php echo $country ?></td>
</tr>
<?php
$counter++;
}
?>
</table>
</form>
</body>
</html>