Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

2 color table


I would to know if there is a way to build a 2 color table like this

Each coloured would be an article.

Now I have it with only one color

{$foreach x in (all)$}
<TD align=middle width="13%" background=backgrounonecoloronly.jpg>
<FONT face=verdana>{$setDateTimeFormat "English" "dd/MM/yyyy" "hh:mm"$}{$x.filedDate$}</FONT>
<TD width="87%" background=backgrounonecoloronly.jpg>
<FONT face=verdana color=#000000>

Any idea?

Thanks in advance.

Sunday, August 11, 2002

I don't think you can do it in CityScript yet.  Lots of folks want to do arithmatic in the scripts though.  It's a frequent feature request.

If you can do Java script, you might figure out a way to do it.  See Adriaan's download here (the first one on the page):

If you want a specific article to be a specific color in your table, you could stick the desired color in an extra field.  I don't think that's what you are trying to do though.

Good luck.

Sunday, August 11, 2002

I think I understand the idea, and I have tried this:


{$foreach x in (folder "articles")$} {$.loopincrement$}

<SCRIPT language=JavaScript>document.writeln("<b>Flag:</b>" + loopCounter % 2 + "<br>");</SCRIPT>
Some text<br>

<SCRIPT language=JavaScript>document.writeln("Total rows: " + loopCounter);</SCRIPT>

This way I obtain a flag, that can be part of the name of a background, a color, etc.


Sunday, August 11, 2002

PHP is the other options. I'm thinking of recoding my menu-script to PHP. But I have been lazy since like many people on this forum I am hoping for better script support from citydesk. Why coding dynamic scripts if all you want is a static page (which is one of the strengths of citydesk)?

Adriaan van den Brand
Sunday, August 11, 2002

*  Recent Topics

*  Fog Creek Home