Hello Sunfighter,
Thank you for your reply! (Sorry for my late reaction, but I'm busy with completing our baby room)
A friend of me also told me to use div's, but I'm not very familiar with that.
What I'm trying to do is to display all the customers ("relaties" in Dutch) in blocks. I would like to give a block a 150 px. So in that case, the amount of blocks at one row depends on the width of the page (resolution).
If that is not possible, I would like to set a counter to 5, and after 5 blocks I start with a new row.
This is my code till now:
PHP Code:
<?
$select = "SELECT * FROM relaties ORDER BY id";
$query = mysql_query($select);
if(mysql_num_rows($query) == 0)
{
echo "<div class=\"titel\">Empty</div>";
echo "<div class=\"bericht\">No relations yet.</div>";
}
else
{
echo "<P>";
echo "<div class=\"titel\" style=\"text-align:left;\">relaties</div>";
echo "<div class=\"bericht\" style=\"text-align:left;\">";
echo "<table width=\"99%\" cellpadding=\"5\" cellspacing=\"10\" style=\"text-align:left;\"><TR>";
while($list = mysql_fetch_object($query))
{
$j++;
?>
<td valign="top" style="width:20%;background-color:#ffffff;background-image:url('afbeeldingen/bgbuttons.gif');background-repeat:repeat-y;border:solid 1px #7c9ba7;">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="100%" align="left" style="padding-bottom:2px;"><a href="index.php?pag=relaties&actie=edit&id=<? echo $list->id;?>"><B><? echo $list->Naam;?></B></a></td>
</tr>
<tr>
<td width="100%" align="left" style="padding-bottom:2px;"><? echo $list->Adres;?></td>
</tr>
<tr>
<td width="100%" align="left" style="padding-bottom:12px;"><? echo $list->Postcode;?></td>
</tr>
<tr>
<td width="100%" align="left">(Tarief: € <? echo number_format($list->tarief, 2, ',', '');?>)</td>
</tr>
</table>
</td>
<?
if($j % 5 == 0)
echo "</tr><tr>";
}
echo "</tr></table>";
echo "</div>";
}
?>