Page 1 of 1

displaying results in two columns

Posted: Sun Apr 23, 2006 9:33 am
by ianhull
Hi Guys,

I am trying to display the records from my DB but I need it to be in two columns so that people do not have to scroll down too much. please help

Code: Select all

<?php include_once("connect.php");
$sql = "SELECT card, webaddress, companyname FROM spar ORDER BY companyname";
$r = mysql_query($sql);
if(!$r) {
$err=mysql_error();
echo "Off Line";
echo '<meta http-equiv="refresh" content="20"';
}
if(mysql_affected_rows()==0){
echo "Off Line";
echo '<meta http-equiv="refresh" content="20"';
exit();
}
else{
}
while ($line = mysql_fetch_array($r))    
{
extract($line);

echo '<style type="text/css">
<!--
body {
	background-color: #FF6600;
}
body,td,th {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #FFFFFF;
	font-weight: bold;
}
a {
	font-size: 12px;
	color: #FFFFFF;
	font-weight: bold;
}
a:visited {
	color: #FFFFFF;
}
a:hover {
	color: #FF9900;
}
a:active {
	color: #FFFFFF;
}
-->
</style>
<body scroll="no">
<table width="100%"  border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td align="left" valign="top"><a href="#'.$webaddress.'"><img src="http://www.domain/k/files/'.$card.'" border="0"></a></td>
  </tr>
  <tr>
    <td align="left" valign="top">'.$companyname.'</td>
  </tr>
</table></body>';
}
?>

Posted: Sun Apr 23, 2006 10:47 am
by John Cartwright
viewtopic.php?t=29816

first one on the list :P