Ik wil een image gallery maken in een tabel met maximaal 3 kolommen.
Het aantal rijen is variabel.
Dit is wat ik nu heb, maar deze breekt hem na drie kolommen niet af:
<table cellpadding="0" cellspacing="0">
<tr>
<?php
$map = "map/";
$count = 0;
$dir = opendir($map);
$files = array();
while(false !== ($file= readdir($dir))) $files[] = $file;
asort($files);
foreach ($files as $i=>$file)
{
if(($file !== ".") && ($file !== ".."))
$count = $count + 1;
{
list($filename, $ext) = explode(".", $file);
$ext = strtolower($ext);
if($ext == "jpg") {
echo '<td style="width: 10px;"></td>';
echo '<td style="border: none; outline: none;"><img style="border: none; outline: none;" height="36" width="64" src="'.$map.$file.'" alt="" title=""></td>';
$n++;
}
}
}
closedir($dir);
?>
</tr>
</table>
905 views