color change

Results 1 to 6 of 6

Thread: color change

  1. #1
    dsk Guest

    Default color change

    i want to display the records from the database,i want to display each record different color,pl give me the code ,how to do it.thanxs

  2. #2
    Your Code Friends Guest

    Default RE: color change

    No ones just going to write you the code moron. Go learn it.

  3. #3
    fl1rt Guest

    Default RE: color change

    well I agree that I didn&#039t like the "give me it" part either<BR> - too many greedy developers these days, not actually developing! a contradiction of terms.<BR><BR> you go...<BR><BR>RowCount = 0<BR>CellBGColorONE = "#fe0000"<BR>CellBGColorTWO = "#0000fe"<BR><BR>response.write "&#060;table cellpadding=0 cellspacing=0 border=0&#062;"<BR><BR>Do until objMessageRS.EOF<BR> If RowCount = 2 Then RowCount = 0<BR> If RowCount = 0 Then<BR> Cellbgcolor = CellBGColorONE<BR> Else<BR> Cellbgcolor = CellBGColorTWO<BR> End If<BR><BR>response.write "&#060;tr bgcolor="" & Cellbgcolor & ""&#062;"<BR>response.write "&#060;td&#062;your DB stuff in here&#060;/td&#062;&#060;/tr&#062;"<BR><BR> objMessageRS.MoveNext <BR> RowCount = RowCount + 1<BR><BR>loop<BR><BR>response.write "&#060;/table&#062;"<BR><BR><BR>blah blah blah...very easy stuff.<BR><BR>I&#039d like to see more people actually putting some effort in rather than expecting us to do the work for them.<BR><BR>I know I&#039ll be off, if all I ever read is gimme this, gimme that with the exception of a few guys (you know who you are)

  4. #4
    fl1rt Guest

    Default RE: color change

    ,pl send me the cheque,.thanxs

  5. #5
    al dawg Guest

    Default RE: off the board

    When are you going to make an ASP board of your own and outlaw these idiots. Make it REALLY easy to flame them for begging for free code. <BR><BR>And of course, Sarcasm is a MUST!<BR><BR>:)

  6. #6
    Join Date
    Dec 1969

    Default CONCEPTS (but only little code) RE: color change

    Many people will show you how to alternate back and forth between two colors. Nice. Fine. <BR><BR>But why limit yourself? Why not write code that is generic for *ANY* number of colors?<BR><BR>The concept is easy: You have an array of color values. You pick a color and use it. You move the "picker" to the next element of the array. If the "picker" went past the end of the array you go back to the start.<BR><BR>So something like:<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;theColors = Array("green","blue","red","yellow")<BR>&nbsp;&nbs p;&nbsp;&nbsp;colorPicker = 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;...<BR>&nbsp;&nbsp;&n bsp;&nbsp;Do ...<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;chosenColor = theColors( colorPicker )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;colorPicker = colorPicker + 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;If colorPicker &#062; UBound( theColors ) Then colorPicker = 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;...<BR>&nbsp;&nbsp;&nbsp;&nbsp;Loop<BR><BR>But that&#039s the *CLUMSY* way to do it!!<BR><BR>Can you figure out a better way? <BR><BR>Hint: Think about the MOD operator.<BR><BR>And another: Black text on a blue background is hard to read. Shouldn&#039t you pick a font color that contrasts well with your background color? Of course you should. So how would you do that? <BR><BR>So...partial answers. Maybe they&#039ll get you started thinking in the right directions?<BR><BR><BR><BR>

Posting Permissions

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