December 13, 200124 yr 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
December 13, 200124 yr 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.
December 13, 200124 yr 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>
December 14, 200124 yr 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 : (
Create an account or sign in to comment