September 03, 2010, 11:56:08 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  Home Help Media Affiliates Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: ASP.net table component alternating table row color.  (Read 951 times)
0 Members and 1 Guest are viewing this topic.
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2620
Referrals: 13

WWW Awards
« on: July 21, 2009, 03:53:23 AM »

   To alternate the color of a row in a table you can do this:


Code
GeSHi (csharp):
  1.  for (int i = 0; i < amountOfRows; i++) {
  2.  TableRow row = new TableRow();
  3.         if (i % 2 == 0)
  4.            {
  5.                row.attributes.add("bgcolor", "#fbcce8");
  6.            }
  7.  
  8.            else
  9.            {
  10.                row.attributes.add("bgcolor", "#fef2f9");
  11.            }
  12.        }
Created by GeSHI 1.0.7.20
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
Javaforums.net :: a community about Java software development.
« on: July 21, 2009, 03:53:23 AM »

 Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Your Ad Here
Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.158 seconds with 32 queries.

Google visited last this page September 01, 2010, 11:23:59 PM