BarneyJoe Posted March 2, 2013 Share Posted March 2, 2013 I have a page here, that uses a bit of PHP to loop a series of checkboxes. I've posted a screenshot here: http://www.handprintwebdesign.co.uk/gsg_checkboxes/ I have the stripes working, but not the rules for the checkboxes so that they don't appear with a border in IE. So I have a couple of rules in my CSS: .tickbox_odd { border: 0; background-color:#006; } .tickbox_even { border: 0; background-color: #990000; } And at the moment, the code I have looks like: (the line in bold is the key line) while ($keyword=mysql_fetch_assoc($query)) { //If new category close previous row & display new category if ($keyword['Category']!=$current_category) { if ($current_category && $column !=1 ) { echo "</tr>\n"; } $current_category = $keyword['Category']; echo "<tr class=\"categorycell\"><td colspan=\"10\">$current_category</td></tr>\n"; $column = 1; $row_type=""; } //Create new row if 1st keyword if ($column == 1) { $row_type = ($row_type=="odd")?"even":"odd"; echo "<tr class=\"".$row_type."\">"; } //Display the checkbox echo "<td width=\"2%\">"; echo "<input type=\"checkbox\" class=\"tickbox_".$row_type."\""; if (in_array($keyword['ActivityID'],$photokeywords)) { echo " checked"; } echo " name=\"ckbox[".$keyword['ActivityID']."]\" id=\"ckbox[".$keyword['ActivityID']."]\">"; echo "</td>\n"; //Display the Keyword echo "<td width=\"18%\" align=\"left\">".$keyword['Activity']."</td>\n"; //Close the row if 5th keyword OR increase column count if ($column == 4) { echo "</tr>"; $column = 1; } else { $column++; } } if ($column != 1) { echo "</tr>"; } But that isn't working - any help with this would be appreciated, just to get this detail tidied up. Thank you. Link to comment https://forums.phpfreaks.com/topic/275128-php-syntax-adding-references-to-css-amongst-php-loop/ Share on other sites More sharing options...
BarneyJoe Posted March 4, 2013 Author Share Posted March 4, 2013 Just to say I have now resolved this one. Link to comment https://forums.phpfreaks.com/topic/275128-php-syntax-adding-references-to-css-amongst-php-loop/#findComment-1416416 Share on other sites More sharing options...
trq Posted March 4, 2013 Share Posted March 4, 2013 Cool, mark the thread solved then please. Link to comment https://forums.phpfreaks.com/topic/275128-php-syntax-adding-references-to-css-amongst-php-loop/#findComment-1416418 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.