In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > I know im probibly getting irritating to most of you :P but i thought i may > ask another thing that is on my mind! > > I have a sql query bringing back 200 rows for arguments sake, From this i > would like an answer to 2 issues i have. > > 1) I know how to display it row after row going down :P duh of course :P, > but i have seen sites where it goes across then down across then down ect > ect like X -> X then next row ect. How is this done??
Easy enough; keep a count of how many records you have processed and use the modulus operator % to determine where you want to start a new <TR> > 2) How can i alternate the colours for each row?? row 1 eg light blue and > the 2nd row dark blue then back to light blue ect ect. There will be at least n different ways of doing this; one would be to change the colour using the above test as a trigger. Another is via a simple ternary operator test: $bgcolour = ($bgcolour == '#FF0000' ? '#00FF00' : '##FF0000); In other words if $bgcolour is currently red then make it blue else make it red. > Thanks in advance > -- Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php