Sharky Posted June 5, 2002 Posted June 5, 2002 is it possible to make the search result rows like: white gray white gray etc... without using a background picture that is as big as 2 rows and has two different colors? Adding a field to the database with a calculation? like if: currentrecordnumber%2=0 gray else white
Keith M. Davie Posted June 5, 2002 Posted June 5, 2002 Here's something which may be useful. I copied it a while ago, so I can't give you the proper thread. But I do credit the original poster. ______________ Jeff Spall: Hi, yes it's quite easy when you've done it!! Here's one that changes the colour of the table cell. the database has a calculation field 'colourfield', which is: ---------------------- Case(status="on server","66ccff", status="accepted","00cc66", status="resend","ff3300", status="new version","66ccff","ffffff") ---------------------- so the cell turns blue, red, green, white depending on the status of the job in the html: ---------------------- <TD WIDTH=50 BGCOLOR="#[fmp-field:colourfield]"> ---------------------- In this database, the text is greyed out when the job is still with the production department, so I use an "IF" in the page: ---------------------- <FONT SIZE="-1" FACE="verdana,arial,geneva,sans-serif" ______________ Or use JavaScript.
Sharky Posted June 5, 2002 Author Posted June 5, 2002 but this is different... it is based on currentrecordnumber and not a static thing. How do I make it based on currentrecordnumber?
Turansky Posted June 5, 2002 Posted June 5, 2002 Here's how I do alternate row colors. 1) Create a calculation Field, call it rowColor 2) If(Mod(Status (CurrentRecordNumber), 2) = 0, "#CCCCCC", "#FFFFFF") 3) Under Storage Options, make sure and check the "do not store calculated results box" This will not work unless you do that. 4) In the HTML document: <table> [FMP-RECORD] <tr> <td bgcolor="[FMP-Field:rowColor]">[FMP-Field:firstName]</td> <td bgcolor="[FMP-Field:rowColor]">[FMP-Field:lastName]</td> </tr> [/FMP-RECORD] </table>
Sharky Posted June 5, 2002 Author Posted June 5, 2002 I will try that. Could you explain what what does? or is that a no-ask-question?
Turansky Posted June 5, 2002 Posted June 5, 2002 It's all magic to me but here are a few things that should help you. > 1) Create a calculation Field, call it rowColor You will call to this field in your table. > 2) If(Mod(Status (CurrentRecordNumber), 2) = 0, "#CCCCCC", "#FFFFFF") Here is the function to determine which color will be used. Status (CurrentRecordNumber) - will return the number of the current record in the current found set. Mod - Returns the remainder after CurrentRecordNumber is divided by 2. If - will return one of the results. In this case a color. > 3) Under Storage Options, make sure and check the "do not store calculated results box" This will not work unless you do that. I beleive the default is set to unchecked. > 4) In the HTML document: <table> [FMP-RECORD] <tr> <td bgcolor="[FMP-Field:rowColor]">[FMP-Field:firstName]</td> This is where you will call to the field that will display the color. <td bgcolor="[FMP-Field:rowColor]">[FMP-Field:lastName]</td> </tr> [/FMP-RECORD] </table> Have a great day Kent
Sharky Posted June 5, 2002 Author Posted June 5, 2002 thanx I didn't know what Mod was... but now I know Mod is the same as % in java
Recommended Posts
This topic is 8305 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now