[thelist] dynamic verticle bar in PHP (table)

Roger Harness magic32 at jps.net
Thu Oct 2 03:34:18 CDT 2003


Hello 'Volters,

I'd like to have a simple table, 1 cell wide, but 10 cells high.

Using PHP, is there a way to dynamically change the background of a specific
cell, and also all cells below that one?

So if my result was the number 4, the bottom four cells (rows) would have a
green background, while the top six would have no background. If my number
was 2, then only the bottom two cells would have the green background.

I think I know I could create a if/then/else or case statement, so IF my
number is 3, then create a table with only the bottom 3 cells have a
cellbackgound color, ELSIF the number is 4, then create a table with only
the bottom 4 cells have a cell background color etc etc etc, but it just
seems like there's *got* to be a more efficient way!

any suggestions/pointers would be much apprecited!!


-Roger Harness



More information about the thelist mailing list