> $rows = $cols + ceil(($numdata-($cols*$cols))/$cols);
Seb suggested a much easier way:
$rows = ceil($numdate/$cols);
--
Chris Hobbs Silver Valley Unified School District
Head geek: Technology Services Coordinator
webmaster: http://www.silvervalley.k12.ca.us/~chobbs/
post
Hmmm. No code, but I'm guessing you'll probably want to set the width of
the table to be int(sqrt(mysql_num_rows($results))), and then set up
your loops to place only that amount of cells across. Then just keep
going til you run out of data.
So in the example of 31, you'd set the number of column
rward...
- seb
-Original Message-
From: Ian Grant [mailto:[EMAIL PROTECTED]]
Sent: 25 July 2001 17:28
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: Making a new row in HTML tables
Yeah, but if I had 31,
I'd want 6x5 and then 1 over, or something
Hugh Bothwell <[EMAIL PROTECT
of blank fields.
Robert Klinkenberg
> -Oorspronkelijk bericht-
> Van: Ian Grant [SMTP:[EMAIL PROTECTED]]
> Verzonden:Wednesday, July 25, 2001 6:28 PM
> Aan: [EMAIL PROTECTED]
> Onderwerp: [PHP-DB] Re: Making a new row in HTML tables
>
> Yeah, but if I had 3
> -Original Message-
> From: Ian Grant [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 25, 2001 11:28 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Re: Making a new row in HTML tables
>
>
> Yeah, but if I had 31,
> I'd want 6x5 and then 1 over, or so
Yeah, but if I had 31,
I'd want 6x5 and then 1 over, or something
Hugh Bothwell <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Umm... 31 entries, 1 x 31...
>
> You might be better to choose a standard width and pad the last row with
> empty cells.
>
> "Ia
Umm... 31 entries, 1 x 31...
You might be better to choose a standard width and pad the last row with
empty cells.
"Ian Grant" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> Can anyone help me with this - I have a database of people, that I want to
>