Closed Thread Icon

Topic awaiting preservation: Formatting tables (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12221" title="Pages that link to Topic awaiting preservation: Formatting tables (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Formatting tables <span class="small">(Page 1 of 1)</span>\

 
Wakkos
Maniac (V) Mad Scientist

From: Azylum's Secret Lab
Insane since: Oct 2000

posted posted 05-18-2002 13:05

Hello! me again, I hope to be clear this time! =D

I want to print results in a table, but I've seen ways to do it only vertical.

Something like this (What i got):

code:
echo	"<TABLE WIDTH='50%' HEIGHT='0' BORDER='0' ALIGN='center' CELLSPACING='0' CELLPADDING='0'>";
while($f = readdir($d))
{
if($f <> "." and $f <> ".."){
echo "<TR>";
echo "<TD align='center'>";
echo "<IMG SRC='$f' border=1><BR>";
echo "$f <BR><BR>";
echo "</TD></TR>";
}
}
echo "</TABLE>";



And I want to print 4 or 5 <td> with database data inside......


I don't find a way to do it... :/

A sig should be here.....
But is not.

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 05-18-2002 13:18

Quick hack, no gurantees for nothing.
(btw, to be XHTML compliant, your tags should be lowercase...)

code:
echo"<TABLE WIDTH='50%' HEIGHT='0' BORDER='0' ALIGN='center' CELLSPACING='0' CELLPADDING='0'>";
echo"<TR>";
$counter = 0;
while($f = readdir($d))
{
if($f <> "." and $f <> ".."){
echo"<TD align='center'>";
echo"<IMG SRC='$f' border=1><BR>";
echo "$f <BR><BR>";
echo"</TD>";
if ($counter == 5)
{
echo"</tr><tr>";
$counter = 0;
}
}
}
echo"</tr></TABLE>";



Tyberius Prime

Wakkos
Maniac (V) Mad Scientist

From: Azylum's Secret Lab
Insane since: Oct 2000

posted posted 05-18-2002 14:11

Cool!!

I did a change to one line:

code:
echo"<TABLE WIDTH='50%' HEIGHT='0' BORDER='0' ALIGN='center' CELLSPACING='0' CELLPADDING='0'>";
echo"<TR>";
$counter = 0;
while($f = readdir($d))
{
$counter = $counter + 1;
if ($f <> "." and $f <> "..")
{
echo"<TD align='center'>";
echo"<IMG SRC='$f' border=1><BR>";
echo "$f <BR><BR>";
echo"</TD>";
if ($counter == 5)
{
echo"</tr><tr>";
$counter = 0;
}
}
}
echo"</tr></TABLE>";



Just the $counter = $counter + 1; to make the counter work! Thanks a lot Tyb!

A sig should be here.....
But is not.


[This message has been edited by Wakkos (edited 05-18-2002).]

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 05-18-2002 15:48

wish I could claim to have left that part out so you learn something by fixing it...

you're welcome.

maninacan
Paranoid (IV) Inmate

From: Seattle, WA, USA
Insane since: Oct 2001

posted posted 05-18-2002 20:33

I just have a couple things to add.

Instead of $counter = $counter + 1; you could use $counter++; which is shorter, and easier, to me. And instead of using <> to see if it's different you could use != although that's more of a personal preferance, but it just seems more intuitive that way because translated into words in means not equal to, but ya, that's more of a personal thing.

kewl

Mad Scientist

Wakkos
Maniac (V) Mad Scientist

From: Azylum's Secret Lab
Insane since: Oct 2000

posted posted 05-19-2002 08:38

Good sitax stuff Maniacan! I'm trying with these too,,....

A sig should be here.....
But is not.

« BackwardsOnwards »

Show Forum Drop Down Menu