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
https://forums.phpfreaks.com/topic/19761-color-change-issues/
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
https://forums.phpfreaks.com/topic/19761-color-change-issues/#findComment-86352
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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