Codeman0013 Posted September 5, 2006 Share Posted September 5, 2006 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=" <?phpif($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] Quote Link to comment https://forums.phpfreaks.com/topic/19761-color-change-issues/ Share on other sites More sharing options...
ober Posted September 5, 2006 Share Posted September 5, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/19761-color-change-issues/#findComment-86352 Share on other sites More sharing options...
AndyB Posted September 5, 2006 Share Posted September 5, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/19761-color-change-issues/#findComment-86353 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.