the walker Posted December 13, 2001 Posted December 13, 2001 is it posible to change a cells colour in a table with and if statment what i am trying to do is if a field is a certain values i want the cell to stand out as a different colour
The Bridge Posted December 13, 2001 Posted December 13, 2001 My approach would be to create a calculation field in the database itself, e.g.: If the field you want to base the change on is Field_1, then define field Cell_Colour = Case(Field_1="foo", "#333333", Field_1="bar", "#666666", "#FFFFFF") In your -Format file, modify your table like so: <table> <tr> <td bgcolor="[FMP-Field:Cell_Colour]"> [FMP-Field:Field_1] </td> </tr> </table> This is a basic example, and I should point out that the bgcolor attribute is deprecated in favour of style sheets. If you take that approach, you would define the classes of the various <td> that you'd be using in your document and instead of specifying a specific RGB colour in your calculated field you would specify the name of the appropriate class. Hope this makes sense! P.S. I should also point out that the above example is missing the [FMP-Record]...[/FMP-Record] tags. Insert these where appropriate.
dspires Posted December 13, 2001 Posted December 13, 2001 I do this quite a bit. Use an if statement in the CDML like so: [FMP-IF: field: Wire .eq. No 5MD1 !] <TD ALIGN=CENTER BGCOLOR="RED"> [FMP-Else] <TD ALIGN=CENTER BGCOLOR="#AFEEEE"> [/FMP-IF] <B>[FMP-field: Wire]</B> </TD>
CyberSport Posted December 14, 2001 Posted December 14, 2001 Thanks for the reassurance! I had done this before, but in claris home page, it screws up your cdml tag and just gives you the straight CDML/HTML instead, so I was sure I was doing something wrong. So I just tried it anyways (even though the tags look screwy) and sure enough... Woo hoo! I'm sure CHP version 4.0 would've corrected this : (
Recommended Posts
This topic is 8449 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