Table, rows color

Results 1 to 2 of 2

Thread: Table, rows color

  1. #1
    Join Date
    Dec 1969

    Default Table, rows color

    I have a table and I am creating it rows based on the records I get from database.<BR>I need to alternate the row colors. <BR>Exp. Row number 1 will have the white color and<BR>Row number 2 will have the blue color.<BR>I am using For, Next Loop to create the these rows.<BR>How can I give alternate colors to the table?<BR>Thanks<BR>Vinay Basnal<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Table, rows color

    You can do this,<BR><BR>for i=0 to NUM_ROWS<BR> if i mod 2 = 0 then &#039this checks if the row no is odd or even<BR> response.write"&#060;tr bgcolor=&#039white&#039&#062;&#060;/tr&#062;"<BR> else<BR> response.write"&#060;tr bgcolor=&#039blue&#039&#062;&#060;/tr&#062;"<BR>next<BR><BR>Hope this helps. :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts