Log in

View Full Version : Auto number of table columns



itskimical
12-03-2010, 01:18 AM
I have a table that i need to make three (3) columns wide. Right now it is only two (2) wide - but I am not sure how to go about increasing the column number.


echo "<tr><td align=\"center\" colspan=\"3\">$uploadmsg</td></tr>";

if ($dir = @opendir("$directoryname"))
{
while (($file = readdir($dir)) !== false)
{
$filecheck = strtolower(substr($file, -4));
if($filecheck == ".gif" OR $filecheck == ".jpg" OR $filecheck == "jpeg" OR $filecheck == ".png")
{
$filelist[] = $file;
}
}
closedir($dir);
}

if (!$filelist)
echo "<tr><td align=\"center\" colspan=\"3\"><i>No Images Found</i></td></tr>";
else
{
asort($filelist);
// while (list ($key, $val) = each ($filelist))
for ($fl = 1; list ($key, $val) = each ($filelist); ++$fl)
{
if (($fl + 1) % 2 == 0)
echo "<tr>";
echo "<td align=\"center\">";



echo "<a href=\"$directoryname/$val\" style=\"text-decoration: none; color: #000000\" target=\"_blank\"><img src=\"$directoryname/$val\" style=\"max-height:100px; max-width:100px; border:1px solid #AEC4D1;\" target=\"_blank\"><br/>$val</a> &nbsp; <a href=\"images.php?imagedir=$imagedir&imgname=$dirname/$val&fcn=del\">DEL</a>";
echo "</td>";
if ($fl % 2 == 0)
echo "</tr>";

Where do I indicate to make another column?