Tip

Alternating Row Colors In Web Views

In a Notes client application, it is easy to set the View property to alternate
the color of rows in a view. On the web, this property does not work. The
following tip does the same on the web.

This particular example ("PT1") displays the "LastName, FirstName" as a link to
that document. All other columns are displayed as plain text.
Remember to have the Opening "&LTTR>" tag in the first column, and the Closing
"</TR>" tag inthe last column.

Add "PT1" to your first column formula.
Add "PT3" to your last column formula.
Add "PT2" to any column formula in between.
REM "PT1";
myname:=@ProperCase(LastName+", "+FirstName);
UNID:=@Text(@DocumentUniqueID);

"&LTscript language=javascript> document.write(\'&LTTR BGColor=\' + (" + @DocNumber
+ " % 2 ? \'ffffca\' : \'ffffff\') + \'>&LTTD valign=top>\'); </Script>&LTFont
Face=Arial size=2>&LTa
href=../database.nsf/view/"+UNID+"?OpenDocument>"+myname+"</a></Font></td>"

=================================================

REM "PT2"
"&LTscript language=javascript> document.write(\'&LTBGColor=\' + (" + @DocNumber +
" % 2 ? \'ffffca\' : \'ffffff\') + \'>&LTTD valign=top>\'); </Script>&LTFont
Face=Arial size=2>"+viewable_value_or_field_here+"</Font></td>"

=================================================

REM "PT3"
"&LTscript language=javascript> document.write(\'&LTBGColor=\' + (" + @DocNumber +
" % 2 ? \'ffffca\' : \'ffffff\') + \'>&LTTD valign=top>\'); </Script>&LTFont
Face=Arial size=2>"+viewable_value_or_field_here+"</Font></td></tr>"

This was first published in November 2000

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.