Jump to content

jesusislord25

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jesusislord25's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yes I did check that. However, I ran through the code again. I had to change $i to $j since I was already using $i for something else. I simply forgot to change one of the $i in your script to $j. I changed that and it worked great. Sorry for being a retard there. I greatly appreciate your help and I love the the video you link to in your signature. Have a Merry Christmas
  2. Pikachu2000: I tried your code and it alternated colors between rows instead of between categories. I have mutliple categories . So there might be 5 rows with the same category, then say 3 rows with a different category, and then maybe 6 rows with yet another category. This can go on and on. What I want to do it make the rows the same color for each category. So in the example above the first 5 rows would be color CCCCFF and then the next 3 rows would be color CCCCCC and then the next 6 rows would be back to CCCCFF. So the background color would alternate color when the category changes. I also played with the other posts, but I was not quite sure how to make it work with my query pulling in the results.
  3. Good Day, I am trying to create a table where the background color alternates between colors based on the category. The query sorts the category in alphabetical order. So for every category that is the same the background color will be the same. When the category changes, the background color changes. Alternating between two colors will be fine. I am not even sure where to begin on the sort of loop. So I want php to create a table like below: <table width="300" border="1" cellspacing="0" cellpadding="0"> <tr bgcolor="#CCCCCC"> <td width="117">Category 1</td> <td width="177">Excetion data</td> </tr> <tr bgcolor="#CCCCCC"> <td>Category 1</td> <td>Excetion data</td> </tr> <tr bgcolor="#CCCCCC"> <td>Category 1</td> <td>Excetion data</td> </tr> <tr bgcolor="#FFFFCC"> <td>Category 2</td> <td>Excetion data</td> </tr> <tr bgcolor="#FFFFCC"> <td>Category 2</td> <td>Excetion data</td> </tr> <tr> <td bgcolor="#CCCCCC">Category 3</td> <td bgcolor="#CCCCCC">Excetion data</td> </tr> <tr> <td bgcolor="#CCCCCC">Category 3</td> <td bgcolor="#CCCCCC">Excetion data</td> </tr> <tr> <td bgcolor="#CCCCCC">Categor 3</td> <td bgcolor="#CCCCCC">Excetion data</td> </tr> </table>
  4. Hello, I have table that I have setup with two rows. The first row is the header row that reads: ID, Date, etc... The second row pulls from a database and repeats everything in the database. I would like to have the 1st row repeat say every 20 rows throughout the data. How do I go about doing this?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.