Re: Tables question.

by "Art Zoller Wagner" <art(at)zollerwagner.com>

 Date:  Tue, 4 Feb 2003 02:43:18 -0500
 To:  "Beauford.2002" <beauford.2002(at)rogers.com>,
<hwg-basics(at)hwg.org>
 References:  markone p1 markone2 p12
  todo: View Thread, Original
Hi, Beauford,

If the ID is guaranteed to be sequential, it might work, but if there is
ever any skipping of numbers, it'll fail.

It seems to me that you might have the output go through a little "tic toc"
routine, where you assign a value which is always going back and forth
between true and false. so you could then assign one css to entries with
TRUE and another with entries that carry the FALSE value.

Hmm. Or, if you always multiply a non-zero variable by -1, then it will go
back and forth between - and +.
So a variable would be given the value of 1, then each time through the
output loop, you'd assign one css (or background color to a cell if you
prefer) for those with >0, and a default to the other. That's cleaner, isn't
it? I like it!

Does anyone know of a simpler way?

best wishes, Art

========
"Beauford.2002" wrote:
I am using a guestbook I wrote in PHP which stores the data in a MySQL
database. I have a table which displays the information for each entry in
the guestbook. There is an ID number for each entry which I could use to
determine which one gets which color, but this seems to be a messy way of
doing it.

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA