Alternating rows in a list
Varen Swaab
public at veggio.com
Wed Apr 20 12:44:23 EDT 2005
Thanks Gordon but this example makes the text alternate in color not
the background of the text. I presume that there is no way to do this
based on other comments here. Table support in htmlText would be
greatly appreciated.
Var
On Apr 19, 2005, at 10:29 PM, Gordon Tillman wrote:
> Howdy Varen,
>
> About your post:
>
>> I'm trying to format a list field which displays plain old html with
>> a list of links. I'd like to format the list so that each link in the
>> list is an alternating color such as white, light grey, white, light
>> grey, etc.....
>
> Here is an example which may get you started..
>
> Given a simple stack with one card that has two fields on it:
>
> (1) field "htmlFld" that displays the information, and
> (2) field "entryFld" where you can enter sample HTML to play with.
>
>
> Field "entryFld" has the following script:
>
> on enterInField
> set the htmlText of field "htmlFld" to me
> end enterInField
>
> And I entered the following into field "entryFld":
>
> <font color="black">Line 1
> <li><font color="green">Line 2
> <li><font color="blue">Line 3
>
> When you hit enter with the cursor in field "entryFld", then field
> "htmlFld" displays this:
>
> Line 1
> Line 2
> Line 3
>
> The first line is black, the second line is green, and the third line
> is blue.
>
>
> OK, here is another idea...
>
> Given a card with a field that contains the list of data to colorize,
> this script will set the colors to alternate:
>
> on mouseUp
> local tColor1, tColor2, tLastColor
> put "blue" into tColor1
> put "green" into tColor2
> put tColor1 into tLastColor
> local tLine
> repeat with tLine = 1 to the number of lines of field 1
> set the textColor of line tLine of field 1 to tLastColor
> if tLastColor is tColor1 then put tColor2 into tLastColor
> else put tColor1 into tLastColor
> end repeat
> end mouseUp
>
> --gordon
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list