Jump to content

Archived

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

Codeman0013

Color change issues?

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]

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites
Run it. View the source of the [b]generated[/b] html code. Look at the class definitions for the question and answer rows and ensure those are defined in a style file that's loaded when this page is called.

Share this post


Link to post
Share on other sites

×

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.