Jump to content

Color change issues?


Codeman0013

Recommended Posts

Hey guys the following code is supposed to alternate colors on a q and a thing but for some reason its not working? I took this page over and i'm still trying to get all the bugs worked out here is the code:


[code=php:0]    <?php if ($totalRows_rs_employeeinfo > 0) { // Show if recordset not empty ?>
<?php
  while (!$rs_employeeqa->EOF) {
?>
   
      <tr class="
 
<?php
if($SSAdv_m1%$SSAdv_change_every1==0 && $SSAdv_m1>0){
$SSAdv_k1++;
}
print $SSAdv_colors1[$SSAdv_k1%count($SSAdv_colors1)];
$SSAdv_m1++;
?>">
          <td valign="top" width="175"><p><b><?php echo $rs_employeeqa->Fields('staffquestion'); ?></b></p></td>
          <td valign="top"><p><?php echo $rs_employeeqa->Fields('staffanswer'); ?></p></td>
      </tr>
     

  <?php
    $rs_employeeqa->MoveNext();
  }
?>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_rs_employeeqa == 0) { // Show if recordset empty ?>
[/code]
Link to comment
Share on other sites

What exactly are you coloring in the row?  Normally when I alternate row colors, I color the actual <td> elements, not the <tr>.

When you say it's not working, is it just not coloring the rows or are you getting an error?  Have you looked at the HTML code once the page is created to make sure that the output is what you expect?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.