Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

2 color table

Hello!

I would to know if there is a way to build a 2 color table like this http://www.arrakis.es/~rporcar/aplicaciones.html

Each coloured would be an article.

Now I have it with only one color

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

Any idea?

Thanks in advance.

Roberto
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):

http://tk-jk.net/city/Articles/fog0000000010.html

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.

tk
Sunday, August 11, 2002

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

{$.loopstart$}

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

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

<hr>
<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.

Thanks!

Roberto
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